Skip to content

Commit 4cefdfc

Browse files
committed
remove position only args.
1 parent 4f539ae commit 4cefdfc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/pytask_parallel/backends.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313

1414
def deserialize_and_run_with_cloudpickle(
15-
fn: Callable[..., Any], /, kwargs: dict[str, Any]
15+
fn: Callable[..., Any], kwargs: dict[str, Any]
1616
) -> Any:
1717
"""Deserialize and execute a function and keyword arguments."""
1818
deserialized_fn = cloudpickle.loads(fn)
@@ -23,13 +23,14 @@ def deserialize_and_run_with_cloudpickle(
2323
class CloudpickleProcessPoolExecutor(ProcessPoolExecutor):
2424
"""Patches the standard executor to serialize functions with cloudpickle."""
2525

26-
def submit(
27-
self, fn: Callable[..., Any], /, *args: Any, **kwargs: Any # noqa: ARG002
26+
# The type signature is wrong for version above Py3.7. Fix when 3.7 is deprecated.
27+
def submit( # type: ignore[override]
28+
self, fn: Callable[..., Any], *args: Any, **kwargs: Any # noqa: ARG002
2829
) -> Future[Any]:
2930
"""Submit a new task."""
3031
return super().submit(
3132
deserialize_and_run_with_cloudpickle,
32-
cloudpickle.dumps(fn),
33+
fn=cloudpickle.dumps(fn),
3334
kwargs=cloudpickle.dumps(kwargs),
3435
)
3536

0 commit comments

Comments
 (0)