-
Notifications
You must be signed in to change notification settings - Fork 4
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
[Do Not Merge] Create memory root to avoid server error #88
base: main
Are you sure you want to change the base?
Conversation
Can you please show what happens without this? |
Yes, sorry about that. Here is what I have now that I looked into it a bit more as well: Browser Response Payload:
*where the description is the error message Browser Console Error Message:
Server output:
The issue is in my GET handler logic: https://github.com/fsspec/jupyter-fsspec/blob/main/jupyter_fsspec/handlers.py#L253 |
Below is the full output that I should see from the server.
I think I can make these updates separately, so I can keep my changes here targeting to original issue. I intend to try updating and reusing the jupyter-fsspec/jupyter_fsspec/handlers.py Lines 18 to 35 in c2690fb
|
# Temporary fix to handle memory filesystems with empty root path | ||
if fs_protocol == "memory": | ||
if not fs.exists(fs_path): | ||
fs.mkdir(fs_path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might happen on any filesystem - trying to list a directory that doesn't exist will be FileNotFound (if the filesystem has directories at all). So should generalise this to any protocol?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right, I don't think that this behavior aligns with typical filesystem expectations. Initially, I was considering cases where a user specifies a memory filesystem path in the config, where I might be inclined to expect the memory filesystem root to exist... but once users can add files and such to the memory filesystem, the root would eventually be created, so it's not really a problem.
I'm wondering if it would be best to propagate the FileNotFound
to the frontend then, or would it be more appropriate to interpret the query to the root of an empty memory filesystem as an empty list? Since fsspec
would normally raise an error, I'm leaning towards doing that for consistency. In terms of the user experience, I wonder if that could be misleading? I guess for that the backend can raise this error and let the frontend handle this case and how it's presented to the user? I would appreciate your thoughts on this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since I'm leaning toward the first option, I think I may close this.... I'm working on the exception handling separately and I've pulled in the clean up commits from this PR there.
Bringing back this block of code that creates the root path for a memory file system. Currently, the root path is not recognised as a directory after we instantiate a memory filesystem. Maybe there are better ways to address this?
Follow-up from #86 and #87