@@ -308,7 +308,7 @@ def _maybe_assign_store_instance_ids(self):
308308 # Determine common prefixes of paths (and call them roots)
309309 prefixes = _get_common_prefixes (paths )
310310 if len (prefixes ) < 1 :
311- roots = prefixes
311+ roots = [ '' ]
312312 else :
313313 # perform further step to merge prefixes with same start
314314 prefixes = list (set (prefixes ))
@@ -329,6 +329,8 @@ def _maybe_assign_store_instance_ids(self):
329329 while not root .endswith ("/" ) and not root .endswith ("\\ " ) and \
330330 len (root ) > 0 :
331331 root = root [:- 1 ]
332+ if root .endswith ("/" ) or root .endswith ("\\ " ):
333+ root = root [:- 1 ]
332334 abs_root = root
333335 # For local file systems: Determine absolute root from base dir
334336 fs_protocol = FS_TYPE_TO_PROTOCOL .get (file_system , file_system )
@@ -352,28 +354,32 @@ def _maybe_assign_store_instance_ids(self):
352354 store_instance_id = f'{ fs_protocol } _{ counter } '
353355 data_store_pool .add_store_config (store_instance_id ,
354356 data_store_config )
355-
356357 for config in config_list :
357358 if config ['Path' ].startswith (root ):
358359 config ['StoreInstanceId' ] = store_instance_id
359- config ['Path' ] = config ['Path' ][len (root ):]
360+ new_path = config ['Path' ][len (root ):]
361+ while new_path .startswith ("/" ) or \
362+ new_path .startswith ("\\ " ):
363+ new_path = new_path [1 :]
364+ config ['Path' ] = new_path
360365
361366 def _get_other_store_params_than_root (self ,
362367 dataset_config : DatasetConfigDict ) \
363368 -> Dict :
364369 if FS_TYPE_TO_PROTOCOL .get (dataset_config .get ('FileSystem' ,
365370 'file' )) != 's3' :
366371 return {}
367- store_params = dict ()
372+ storage_options = dict ()
368373 if 'Anonymous' in dataset_config :
369- store_params ['anon' ] = dataset_config ['Anonymous' ]
374+ storage_options ['anon' ] = dataset_config ['Anonymous' ]
370375 client_kwargs = dict (
371376 )
372377 if 'Endpoint' in dataset_config :
373378 client_kwargs ['endpoint_url' ] = dataset_config ['Endpoint' ]
374379 if 'Region' in dataset_config :
375380 client_kwargs ['region_name' ] = dataset_config ['Region' ]
376- store_params ['client_kwargs' ] = client_kwargs
381+ storage_options ['client_kwargs' ] = client_kwargs
382+ store_params = dict (storage_options = storage_options )
377383 return store_params
378384
379385 def get_dataset_configs_from_stores (self ) \
0 commit comments