Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose decompression_executor and interpretation_executor in uproot dask #1120

Merged
merged 4 commits into from
Feb 20, 2024

Conversation

ioanaif
Copy link
Collaborator

@ioanaif ioanaif commented Feb 5, 2024

No description provided.

@ioanaif ioanaif linked an issue Feb 5, 2024 that may be closed by this pull request
@ioanaif
Copy link
Collaborator Author

ioanaif commented Feb 9, 2024

This PR doesn't add tests; however, it was tested locally to make sure the executors are exposed correctly.

I used the tests in file test_1058_dask_awkward_report.py to which I added a decompression_executor and an interpretation_executor with the submit function modified to change a variable when called.

All seems to be working well :)

Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect this:

class TestExecutor(uproot.source.futures.TrivialExecutor):
    def __init__(self):
        self.submit_count = 0
    def submit(self, task, /, *args, **kwargs):
        self.submit_count += 1
        super().submit(task, *args, **kwargs)

testexecutor = TestExecutor()

a = uproot.dask({
    skhep_testdata.data_path("uproot-Zmumu-zlib.root"): "events"
}, compression_executor=testexecutor)

a["pt1"].compute()

to result in a testexecutor.submit_count that is not 0. (Same for interpretation_executor.)

Am I testing it incorrectly? What did you test to see that it worked?

In fact, if I replace the counter with raise Exception, a["pt1"].compute() returns a result without anything raising an exception. Uproot is not calling submit on the provided executor.

Copy link
Member

@jpivarski jpivarski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, great! Looking at the differences since last time, it was just a matter of passing the arguments further down (into those "UprootOpenAndRead" classes), not that the executors aren't working even on eager reads.

This is good to merge! Squash-and-merge whenever you're ready!

@ioanaif ioanaif merged commit 8386b3e into main Feb 20, 2024
21 checks passed
@ioanaif ioanaif deleted the ioanaif/feat-expose-executors-dask branch February 20, 2024 18:18
@nsmith-
Copy link
Collaborator

nsmith- commented Mar 7, 2024

The Protocol was not updated alongside the implementations
https://github.com/scikit-hep/uproot5/pull/1120/files#diff-6780d7d16e83cfee3f1d68397d1301711fd5b0bbe56633a2fe17e0de6f18d8d3R830-R837
Are we doing any type-checking in the linting? I see a lot of typing in this file but mypy has a bad time running on it

@jpivarski
Copy link
Member

#1163 fixes that. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose decompression_executor in uproot.dask
3 participants