File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -40,13 +40,13 @@ def _normalize_storage_options(path: UPath) -> dict[str, Any] | None:
4040 - Automatically redirects gs:// URLs to a local fake-GCS endpoint
4141 when testing (localhost:4443).
4242 """
43- import gcsfs
4443
4544 # Start with any existing options from UPath
4645 storage_options = dict (path .storage_options ) if len (path .storage_options ) else {}
4746
4847 # Redirect gs:// to local fake-GCS server for testing
4948 if str (path ).startswith ("gs://" ):
49+ import gcsfs
5050 fs = gcsfs .GCSFileSystem (
5151 endpoint_url = "http://localhost:4443" ,
5252 token = "anon" ,
@@ -104,14 +104,14 @@ def to_mdio(
104104 compute : bool = True ,
105105 region : Mapping [str , slice | Literal ["auto" ]] | Literal ["auto" ] | None = None ,):
106106 """Write dataset contents to an MDIO output_path."""
107- import gcsfs
108107 import zarr
109108
110109 output_path = _normalize_path (output_path )
111110 zarr_format = zarr .config .get ("default_zarr_format" )
112111
113112 # For GCS paths, create FSMap for fake GCS server
114113 if str (output_path ).startswith ("gs://" ):
114+ import gcsfs
115115 fs = gcsfs .GCSFileSystem (
116116 endpoint_url = "http://localhost:4443" ,
117117 token = "anon" ,
You can’t perform that action at this time.
0 commit comments