-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(draft): add
report=
argument for uproot.dask
; trigger report…
… collection (take 2!) (#1058) * add report= to trigger dask-awkward creating graceful-failure-report * add mock_empty * whoops * fix mock_empty * backend is passed in upstream; use OSError * Update src/uproot/_dask.py Co-authored-by: Lindsey Gray <[email protected]> * use oop interface * need allowed_exceptions * time and functools * whoops * add to report; small fixes * style: pre-commit fixes * move some methods * whoops * None for success * monotonic -> time * ordering * fixup duration stuff * two impls... * call_time needs to be outside wrapper * rename argument; add function arg description to docstring * add test --------- Co-authored-by: Lindsey Gray <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
c5ff061
commit 66d1feb
Showing
3 changed files
with
208 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import pytest | ||
import skhep_testdata | ||
|
||
import uproot | ||
|
||
|
||
dask = pytest.importorskip("dask") | ||
dask_awkward = pytest.importorskip("dask_awkward") | ||
|
||
|
||
def test_with_report(): | ||
test_path1 = skhep_testdata.data_path("uproot-Zmumu.root") + ":events" | ||
test_path2 = skhep_testdata.data_path("uproot-Zmumu-uncompressed.root") + ":events" | ||
test_path3 = "/some/file/that/doesnt/exist" | ||
files = [test_path1, test_path2, test_path3] | ||
collection, report = uproot.dask( | ||
files, | ||
library="ak", | ||
open_files=False, | ||
allow_read_errors_with_report=True, | ||
) | ||
_, creport = dask.compute(collection, report) | ||
assert creport[0].exception is None # test_path1 is good | ||
assert creport[1].exception is None # test_path2 is good | ||
assert creport[2].exception == "FileNotFoundError" # test_path3 is a bad file |