Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:

- name: Run pytest
run: |
python -m pytest -vv tests --reruns 3 --reruns-delay 30 --only-rerun "(?i)http|timeout|connection"
python -m pytest -vv tests --reruns 3 --reruns-delay 30 --only-rerun "(?i)http|timeout|connection|socket"

vanilla-build:
strategy:
Expand All @@ -91,4 +91,4 @@ jobs:

- name: Run pytest
run: |
python -m pytest -vv tests --reruns 3 --reruns-delay 30 --only-rerun "(?i)http|timeout|connection"
python -m pytest -vv tests --reruns 3 --reruns-delay 30 --only-rerun "(?i)http|timeout|connection|socket"
7 changes: 5 additions & 2 deletions src/uproot/behaviors/TBranch.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
objects themselves.
"""


import queue
import re
import sys
Expand All @@ -21,6 +20,7 @@
import numpy

import uproot
import uproot.interpretation.grouped
import uproot.language.python
from uproot._util import no_filter

Expand Down Expand Up @@ -1809,7 +1809,10 @@ def get_from_cache(branchname, interpretation):
checked = set()
for _, context in expression_context:
for branch in context["branches"]:
if branch.cache_key not in checked:
if branch.cache_key not in checked and not isinstance(
branchid_interpretation[branch.cache_key],
uproot.interpretation.grouped.AsGrouped,
):
checked.add(branch.cache_key)
for (
basket_num,
Expand Down
42 changes: 42 additions & 0 deletions tests/test_0692_fsspec_reading.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import pytest
import uproot
import uproot.source.fsspec
import uproot.source.file
import uproot.source.xrootd
import uproot.source.s3

import skhep_testdata
import queue
Expand Down Expand Up @@ -123,6 +126,7 @@ def test_open_fsspec_ssh(handler):
)
def test_open_fsspec_xrootd(handler):
pytest.importorskip("XRootD")
pytest.importorskip("fsspec_xrootd")
with uproot.open(
"root://eospublic.cern.ch//eos/root-eos/cms_opendata_2012_nanoaod/Run2012B_DoubleMuParked.root",
handler=handler,
Expand Down Expand Up @@ -208,3 +212,41 @@ def test_fsspec_zip(tmp_path):
) as branch:
data = branch.array(library="np")
assert len(data) == 40


# https://github.com/scikit-hep/uproot5/issues/1035
@pytest.mark.parametrize(
"handler",
[
uproot.source.file.MemmapSource,
uproot.source.file.MultithreadedFileSource,
uproot.source.fsspec.FSSpecSource,
None,
],
)
def test_issue_1035(handler):
# remove after https://github.com/scikit-hep/scikit-hep-testdata/pull/132
pytest.importorskip("aiohttp")
with fsspec.open(
"https://github.com/lobis/scikit-hep-testdata/raw/main/src/skhep_testdata/data/uproot-issue-1035.root"
) as f_remote:
with open(
os.path.join(
skhep_testdata.local_files._cache_path(), "uproot-issue-1035.root"
),
"wb",
) as f_local:
f_local.write(f_remote.read())
skhep_testdata.known_files.add("uproot-issue-1035.root")

with uproot.open(
skhep_testdata.data_path("uproot-issue-1035.root"),
handler=handler,
use_threads=True,
num_workers=10,
) as f:
for _ in range(25): # intermittent failure
tree = f["CollectionTree"]
branch = tree["MuonSpectrometerTrackParticlesAuxDyn.truthParticleLink"]
data = branch.array()
assert len(data) == 40