File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments