Skip to content

Commit d9cdc38

Browse files
Explicitly type pickle_func in worker_manager
This patch adds an explicit type for the pickle function in worker_manager. An internal linting tool suggested this.
1 parent ff764c9 commit d9cdc38

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler_opt/distributed/worker_manager.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
"""The interface for WorkerManager."""
1515

1616
import abc
17+
from collections.abc import Callable
1718
from contextlib import AbstractContextManager
1819
import pickle
20+
from typing import Any
1921

2022
from compiler_opt.distributed import worker
2123

@@ -26,7 +28,7 @@ class WorkerManager(AbstractContextManager, metaclass=abc.ABCMeta):
2628
@abc.abstractmethod
2729
def __init__(self,
2830
worker_class: type[worker.Worker],
29-
pickle_func=pickle.dumps,
31+
pickle_func: Callable[[Any], bytes] = pickle.dumps,
3032
*,
3133
count: int | None,
3234
worker_args: tuple = (),

0 commit comments

Comments
 (0)