diff --git a/metaflow/multicore_utils.py b/metaflow/multicore_utils.py index 55704623d5b..6e79c20ada5 100644 --- a/metaflow/multicore_utils.py +++ b/metaflow/multicore_utils.py @@ -60,7 +60,6 @@ def _spawn(func, arg, dir): def parallel_imap_unordered(func, iterable, max_parallel=None, dir=None): - if max_parallel is None: max_parallel = cpu_count() @@ -68,7 +67,6 @@ def parallel_imap_unordered(func, iterable, max_parallel=None, dir=None): pids = [_spawn(func, arg, dir) for arg in islice(args_iter, max_parallel)] while pids: - for idx, pid_info in enumerate(pids): pid, output_file = pid_info pid, exit_code = os.waitpid(pid, os.WNOHANG) diff --git a/test/unit/test_multicore_utils.py b/test/unit/test_multicore_utils.py index db5b9edfa93..9b14a20b99a 100644 --- a/test/unit/test_multicore_utils.py +++ b/test/unit/test_multicore_utils.py @@ -2,4 +2,11 @@ def test_parallel_map(): - assert parallel_map(lambda s: s.upper(), ['a', 'b', 'c', 'd', 'e', 'f']) == ['A', 'B', 'C', 'D', 'E', 'F'] + assert parallel_map(lambda s: s.upper(), ["a", "b", "c", "d", "e", "f"]) == [ + "A", + "B", + "C", + "D", + "E", + "F", + ]