widgetti / widgetti/ipyvuetify

FileInput in databricks notebooks results in a timeout exception on read()

Open
#266 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
355
Forks
61
PR merge metrics
No merged PRs in 30d

Description

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.

from ipyvuetify.extra import FileInput
file_input = FileInput()
file_input
files = file_input.get_files()
data = files[0]['file_obj'].read()
data

I get this timeout exception when I try the read() above -

Exception                                 Traceback (most recent call last)
File <command-2037501063098494>:1
----> 1 data = files[0]['file_obj'].read()
      2 data

File /local_disk0/.ephemeral_nfs/envs/pythonEnv-f391b237/lib/python3.9/site-packages/ipyvuetify/extra/file_input.py:147, in ClientSideFile.readall(self)
    146 def readall(self):
--> 147     return self.read(self.size - self.offset)

File /local_disk0/.ephemeral_nfs/envs/pythonEnv-f391b237/lib/python3.9/site-packages/ipyvuetify/extra/file_input.py:143, in ClientSideFile.readinto(self, buffer)
    140         self.widget.update_stats(self.file_index, chunk_size)
    141         await process_messages()
--> 143 asyncio.run(read_all())
    144 return size

File /databricks/python/lib/python3.9/site-packages/nest_asyncio.py:35, in _patch_asyncio.<locals>.run(main, debug)
     33 task = asyncio.ensure_future(main)
     34 try:

Would really appreciate if you have any inputs about this.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the FileInput example in a Databricks notebook, then inspect ipyvuetify/extra/file_input.py, especially ClientSideFile.readall and readinto where the traceback ends. Compare the read() behavior and timeout with the reported code to determine whether the issue is specific to Databricks; done means the failure is reproduced and a verified resolution or documented limitation is established.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.