Skip to content
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

fsspec.gui.FileSelector, doesn't work with remote protocols? #1359

Closed
okz opened this issue Sep 12, 2023 · 4 comments
Closed

fsspec.gui.FileSelector, doesn't work with remote protocols? #1359

okz opened this issue Sep 12, 2023 · 4 comments

Comments

@okz
Copy link
Contributor

okz commented Sep 12, 2023

FileSelector implementation suggests remote protocol support is implemented, but I haven't been able to figure out how to use it?

Maybe the implementation has a bug with storage options?

fsspec.gui.FileSelector("az://.", **so)
>> TypeError: FileSelector.__init__() got an unexpected keyword argument 'account_name'

fsspec.gui.FileSelector("file://.", storage_options=so)
>>
TypeError: FileSelector.__init__() got an unexpected keyword argument 'storage_options'

@okz okz changed the title fsspec.gui.FileSelector, remote protocols fsspec.gui.FileSelector, doesn't work with remote protocols? Sep 12, 2023
@martindurant
Copy link
Member

I see the documentation on this is somewhat lacking. The GUI allows you to supply the initial value of the "kwargs" text widget, which must be a string, but evaluate to a python dict. So something like

fsspec.gui.FileSelector("az://.", kwargs="""{"account_name": "myname"}""")

@okz
Copy link
Contributor Author

okz commented Sep 12, 2023

Ah thanks Martin, I understand why but definitely not obvious.

However there is a bug after all:

The text widget is initialised with an empty dictionary, and since storage_options use the widget value then onwards, an exception is raised immediately.

Fixed the initialisation here:

        --self.kwargs = pn.widgets.TextInput(name="kwargs", value="{}", align="center")
      ++self.kwargs = pn.widgets.TextInput(name="kwargs", value=self.init_kwargs, align="center")

With this change, it seems to work.

@martindurant
Copy link
Member

That does seem right. If you make a PR, I will merge it. This can also be tested easily.

@ianthomas23
Copy link
Collaborator

This was fixed by #1360 so closing as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants