Fazil Topal
06/25/2025, 8:24 AMNok Lam Chan
06/25/2025, 1:07 PMNok Lam Chan
06/25/2025, 1:09 PMRavi Kumar Pilla
06/25/2025, 1:43 PM# Partitioned dataset
if isinstance(dataset_obj, PartitionedDataset):
partition_dir = Path(dataset_obj._path)
filepaths = list(partition_dir.glob("*"))
return filepathsFazil Topal
06/25/2025, 2:24 PMdef get_filepaths(catalog: DataCatalog, name: str) -> str | list[str]:
ds = catalog._get_dataset(name)
if isinstance(ds, PartitionedDataset):
return ds._list_partitions()
else:
return ds._filepathFazil Topal
06/29/2025, 7:49 PMFazil Topal
06/30/2025, 7:21 PMdef get_filepaths(catalog: DataCatalog, name: str) -> str | list[str]:
def append_protocol(fpath: str, protocol: str) -> str:
return f"{protocol}://{str(fpath)}" if protocol != "file" else str(fpath)
ds = catalog._get_dataset(name)
if isinstance(ds, PartitionedDataset):
fpaths = []
for partition in ds._list_partitions():
kwargs = deepcopy(ds._dataset_config)
kwargs[ds._filepath_arg] = partition
pds = ds._dataset_type(**kwargs)
ppath = append_protocol(pds._get_load_path(), pds._protocol)
fpaths.append(ppath)
return fpaths
else:
return append_protocol(ds._get_load_path(), ds._protocol)
Any ideas @Nok Lam Chan @Ravi Kumar Pilla?Ravi Kumar Pilla
06/30/2025, 7:49 PM_path_to_partitionFazil Topal
06/30/2025, 7:53 PMkwargs[ds._filepath_arg] = partition -> this line was the problem, kwargs[ds._filepath_arg] = ds._join_protocol(partition) seems to fix the issue. Before, it was not passing the protocol so it was inferred as local file, not it works correctly. It's a bit weird to access every protected method to get the final path that the file will be read. I wonder if there is plan to expose a public method where we can just fetch the path (load/save path)?Fazil Topal
06/30/2025, 8:16 PMRavi Kumar Pilla
06/30/2025, 8:50 PM