diff --git a/fsspec/gui.py b/fsspec/gui.py index 2e47fdab7..bbc450c77 100644 --- a/fsspec/gui.py +++ b/fsspec/gui.py @@ -262,7 +262,9 @@ def _setup(self): name="protocol", align="center", ) - self.kwargs = pn.widgets.TextInput(name="kwargs", value="{}", align="center") + self.kwargs = pn.widgets.TextInput( + name="kwargs", value=self.init_kwargs, align="center" + ) self.go = pn.widgets.Button(name="⇨", align="end", width=45) self.main = SingleSelect(size=10) self.home = pn.widgets.Button(name="🏠", width=40, height=30, align="end") diff --git a/fsspec/tests/test_gui.py b/fsspec/tests/test_gui.py index f94433331..00586389f 100644 --- a/fsspec/tests/test_gui.py +++ b/fsspec/tests/test_gui.py @@ -8,3 +8,12 @@ def test_basic(): gui = fsspec.gui.FileSelector() assert "url" in str(gui.panel) + + +def test_kwargs(tmpdir): + """confirm kwargs are passed to the filesystem instance""" + import fsspec.gui + + gui = fsspec.gui.FileSelector(f"file://{tmpdir}", kwargs="{'auto_mkdir': True}") + + assert gui.fs.auto_mkdir