Repository navigation
Keep zero-worker map calls serial and honor return_exceptions - #962
Open
justavibedev wants to merge 2 commits into
Open
justavibedev wants to merge 2 commits into
justavibedev wants to merge 2 commits into
Conversation
This branch has not been deployed
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Switching a batch to serial execution for debugging can change what happens to failed items. For example,
parallel(int, ['1', 'bad', '2'], n_workers=0, return_exceptions=True)raises on the second item. With workers, the result includes the exception and processing continues. The first commit uses the existing exception handler in the serial path for both executor types.I also hit a separate problem when reusing a
ProcessPoolExecutor(0). The first call tomapran locally. The second tried to pickle my lambda because the first call had changed the stored worker count to 1. The second commit keeps the configured worker count across calls.I reproduced both failures on main, added notebook tests for each, and ran the full parallel notebook with
nbdev-test nbs/03a_parallel.ipynb --n-workers 0. It passed locally on Python 3.12. Codex assisted with the patch and tests.