Skip to content

Commit fc7f97c

Browse files
authored
support fsspec 2025.10.0 (#7844)
fsspec 2025.10.0
1 parent 03c16ec commit fc7f97c

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
"multiprocess<0.70.19", # to align with dill<0.3.9 (see above)
128128
# to save datasets locally or on any filesystem
129129
# minimum 2023.1.0 to support protocol=kwargs in fsspec's `open`, `get_fs_token_paths`, etc.: see https://github.com/fsspec/filesystem_spec/pull/1143
130-
"fsspec[http]>=2023.1.0,<=2025.9.0",
130+
"fsspec[http]>=2023.1.0,<=2025.10.0",
131131
# To get datasets from the Datasets Hub on huggingface.co
132132
"huggingface-hub>=0.25.0,<2.0",
133133
# Utilities from PyPA to e.g., compare versions

src/datasets/data_files.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,14 +349,18 @@ def resolve_pattern(
349349
pattern, storage_options = _prepare_path_and_storage_options(pattern, download_config=download_config)
350350
fs, fs_pattern = url_to_fs(pattern, **storage_options)
351351
files_to_ignore = set(FILES_TO_IGNORE) - {xbasename(pattern)}
352-
protocol = fs.protocol if isinstance(fs.protocol, str) else fs.protocol[0]
352+
protocol = (
353+
pattern.split("://")[0]
354+
if "://" in pattern
355+
else (fs.protocol if isinstance(fs.protocol, str) else fs.protocol[0])
356+
)
353357
protocol_prefix = protocol + "://" if protocol != "file" else ""
354358
glob_kwargs = {}
355359
if protocol == "hf":
356360
# 10 times faster glob with detail=True (ignores costly info like lastCommit)
357361
glob_kwargs["expand_info"] = False
358362
matched_paths = [
359-
filepath if filepath.startswith(protocol_prefix) else protocol_prefix + filepath
363+
filepath if "://" in filepath else protocol_prefix + filepath
360364
for filepath, info in fs.glob(pattern, detail=True, **glob_kwargs).items()
361365
if (info["type"] == "file" or (info.get("islink") and os.path.isfile(os.path.realpath(filepath))))
362366
and (xbasename(filepath) not in files_to_ignore)

0 commit comments

Comments
 (0)