-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FileInput in databricks notebooks results in a timeout exception on read() #266
Comments
Hi Nithin, It is very difficult for us to debug this, and it might be because the databricks notebook does things slightly different. Some ideas why this may not work are:
Regards, Maarten |
I have a similar issue when using Solara in VS Code: import solara
@solara.component
def Page():
def on_file(file_info: solara.file_drop.FileInfo):
print(file_info)
print(file_info['file_obj'].read())
solara.FileDrop("Drop file here", on_file=on_file)
Page() Timeout
Traceback (most recent call last):
File "c:\ProgramData\Miniconda3\lib\site-packages\solara\hooks\use_thread.py", line 84, in runner
value = f()
File "c:\ProgramData\Miniconda3\lib\site-packages\solara\components\file_drop.py", line 87, in handle_file
wired_files[0]["data"] = wired_files[0]["file_obj"].read()
File "c:\ProgramData\Miniconda3\lib\site-packages\ipyvuetify\extra\file_input.py", line 147, in readall
return self.read(self.size - self.offset)
File "c:\ProgramData\Miniconda3\lib\site-packages\ipyvuetify\extra\file_input.py", line 143, in readinto
asyncio.run(read_all())
File "c:\ProgramData\Miniconda3\lib\site-packages\nest_asyncio.py", line 35, in run
return loop.run_until_complete(task)
File "c:\ProgramData\Miniconda3\lib\site-packages\nest_asyncio.py", line 89, in run_until_complete
return f.result()
File "c:\ProgramData\Miniconda3\lib\asyncio\futures.py", line 201, in result
raise self._exception
File "c:\ProgramData\Miniconda3\lib\asyncio\tasks.py", line 256, in __step
result = coro.send(None)
File "c:\ProgramData\Miniconda3\lib\site-packages\ipyvuetify\extra\file_input.py", line 124, in read_all
raise Exception("Timeout")
Exception: Timeout
Component react.component(solara.components.file_drop.FileDrop) raised exception Exception('Timeout')
Traceback (most recent call last):
File "c:\ProgramData\Miniconda3\lib\site-packages\reacton\core.py", line 1675, in _render
root_element = el.component.f(*el.args, **el.kwargs)
File "c:\ProgramData\Miniconda3\lib\site-packages\solara\components\file_drop.py", line 94, in FileDrop
raise result.error
File "c:\ProgramData\Miniconda3\lib\site-packages\solara\hooks\use_thread.py", line 84, in runner
value = f()
File "c:\ProgramData\Miniconda3\lib\site-packages\solara\components\file_drop.py", line 87, in handle_file
wired_files[0]["data"] = wired_files[0]["file_obj"].read()
File "c:\ProgramData\Miniconda3\lib\site-packages\ipyvuetify\extra\file_input.py", line 147, in readall
return self.read(self.size - self.offset)
File "c:\ProgramData\Miniconda3\lib\site-packages\ipyvuetify\extra\file_input.py", line 143, in readinto
asyncio.run(read_all())
File "c:\ProgramData\Miniconda3\lib\site-packages\nest_asyncio.py", line 35, in run
return loop.run_until_complete(task)
File "c:\ProgramData\Miniconda3\lib\site-packages\nest_asyncio.py", line 89, in run_until_complete
return f.result()
File "c:\ProgramData\Miniconda3\lib\asyncio\futures.py", line 201, in result
raise self._exception
File "c:\ProgramData\Miniconda3\lib\asyncio\tasks.py", line 256, in __step
result = coro.send(None)
File "c:\ProgramData\Miniconda3\lib\site-packages\ipyvuetify\extra\file_input.py", line 124, in read_all
raise Exception("Timeout")
Exception: Timeout I tried to set Edit: It turns out that this is an issue of the Jupyter kernel and VS Code: microsoft/vscode-jupyter#13469. It's already fixed, but not yet released. |
I'm trying to use FileInput to read a file from my local machine in a databricks notebook.
I considered ipywidgets, but databricks doesn't seem to support the file upload feature in ipywidgets - https://docs.databricks.com/notebooks/ipywidgets.html#limitations
This is the code I tried. Picking the file works as expected.
I get this timeout exception when I try the read() above -
Would really appreciate if you have any inputs about this.
The text was updated successfully, but these errors were encountered: