Skip to content

feat: update the executor submit interface to take keyword arguments and be compatible with concurrent.futures.ThreadPoolExecutor #1001

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

Merged
merged 4 commits into from
Oct 19, 2023

Conversation

lobis
Copy link
Collaborator

@lobis lobis commented Oct 19, 2023

We were passing arguments to the tasks as positional, this makes some of the fsspec sources behave differently because they may have different number / order of arguments.

I also modified the definitions to keep the same as concurrent.futures.ThreadPoolExecutor.

I noticied after debugging #999 failure.

@lobis lobis changed the title feat: update the executor submit interface to take keyword arguments and be compatible with concurrent.futures.ThreadPoolExecutor` feat: update the executor submit interface to take keyword arguments and be compatible with concurrent.futures.ThreadPoolExecutor Oct 19, 2023
@lobis lobis mentioned this pull request Oct 19, 2023
"""
Pass the ``task`` and ``args`` onto the workers'
:ref:`uproot.source.futures.Worker.work_queue` as a
:doc:`uproot.source.futures.Future` so that it will be executed when
one is available.
"""
future = Future(task, args)
future = Future(task, *args, **kwargs)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this may cause some problems.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It did, now it's fixed. Perhaps there is a better way to interface this.

@lobis lobis requested review from jpivarski and nsmith- October 19, 2023 19:08
@lobis lobis marked this pull request as ready for review October 19, 2023 19:08
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.

This is good—the Python 3 Executor protocol has a / in the argument list, though this wasn't possible in Python 2.

This is a net improvement and can't break anything (except possible users of uproot.source.futures.*Executor outside of Uproot, though they should be using the Python standard library instead).

I'll merge it.

@jpivarski jpivarski merged commit 9d5e97e into main Oct 19, 2023
@jpivarski jpivarski deleted the source-futures-submit branch October 19, 2023 20:05
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.

2 participants