I am utilizing the FileIinput widget to allow users to upload csv/xlsx. I am using a Bokeh Server and set a callback like so:
My callback works fine and processes the csv/xlsx. However, my app will perform integrity checks on the input data and respond if the data is not in the correct format.
Now, as a user of my app, if I see the error message, correct the file on my machine and then try to re-upload the file, the callback is not triggered.
I can save the file with a new name, and the update works.
So Can I reset the filename property on the FileInput object so that the callback will work when attempting to re-upload the same file? Or do I need to do something as drastic as inserting a new FileInput widget into the document whenever the callback is called? (a workaround that I may try).
Example, run with
bokeh serve [file_name]
then upload the same file twice
from bokeh.plotting import figure, curdoc from bokeh.layouts import layout from bokeh.models import FileInput def hello(attr,old,new): print('hello', attr, old, new) pass f=FileInput(accept='.csv',multiple=False) f.on_change('filename',hello) l=layout(f) curdoc().add_root(l)