From 094ccde4fe7e0a7a8f4820188690a45b2e228c4e Mon Sep 17 00:00:00 2001 From: Lindsey Gray Date: Thu, 14 Dec 2023 11:00:52 -0400 Subject: [PATCH] fix: correct typo in fsspec globbing (#1067) * use file_path instead of files in fsspec globbing * Update test_0692_fsspec_reading.py to include different file name varieties * style: pre-commit fixes --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- src/uproot/_util.py | 2 +- tests/test_0692_fsspec_reading.py | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/uproot/_util.py b/src/uproot/_util.py index 952232f35..894ddbc4b 100644 --- a/src/uproot/_util.py +++ b/src/uproot/_util.py @@ -835,7 +835,7 @@ def _regularize_files_inner( file_names_full = [ file.full_name for file in fsspec.open_files( - files, + file_path, **uproot.source.fsspec.FSSpecSource.extract_fsspec_options(options), ) ] diff --git a/tests/test_0692_fsspec_reading.py b/tests/test_0692_fsspec_reading.py index 2bad9136f..71883ac75 100644 --- a/tests/test_0692_fsspec_reading.py +++ b/tests/test_0692_fsspec_reading.py @@ -392,6 +392,15 @@ def test_issue_1035(handler): @pytest.mark.network @pytest.mark.xrootd +@pytest.mark.parametrize( + "filename", + [ + { + "root://eospublic.cern.ch//eos/root-eos/cms_opendata_2012_nanoaod/Run2012B_*.root": "Events" + }, + "root://eospublic.cern.ch//eos/root-eos/cms_opendata_2012_nanoaod/Run2012B_*.root:Events", + ], +) @pytest.mark.parametrize( "handler", [ @@ -399,13 +408,11 @@ def test_issue_1035(handler): None, ], ) -def test_fsspec_globbing_xrootd(handler): +def test_fsspec_globbing_xrootd(handler, filename): pytest.importorskip("XRootD") pytest.importorskip("fsspec_xrootd") iterator = uproot.iterate( - { - "root://eospublic.cern.ch//eos/root-eos/cms_opendata_2012_nanoaod/Run2012B_*.root": "Events" - }, + filename, ["PV_x"], handler=handler, )