Skip to content

Commit

Permalink
reorder and default parameters for GrpcStateHandlerFactory
Browse files Browse the repository at this point in the history
  • Loading branch information
damondouglas committed Dec 30, 2024
1 parent ed45658 commit 1fe5190
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sdks/python/apache_beam/runners/worker/sdk_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,9 @@ def __init__(
self._data_channel_factory = data_plane.GrpcClientDataChannelFactory(
credentials, self._worker_id, data_buffer_time_limit_ms)
self._state_handler_factory = GrpcStateHandlerFactory(
self._state_cache, self._worker_id, credentials)
state_cache=self._state_cache,
credentials=credentials,
worker_id=self._worker_id)
self._profiler_factory = profiler_factory
self.data_sampler = data_sampler
self.runner_capabilities = runner_capabilities
Expand Down Expand Up @@ -893,8 +895,8 @@ class GrpcStateHandlerFactory(StateHandlerFactory):
Caches the created channels by ``state descriptor url``.
"""
def __init__(self, state_cache, worker_id, credentials=None):
# type: (StateCache, Optional[str], Optional[grpc.ChannelCredentials]) -> None
def __init__(self, state_cache, credentials=None, worker_id=None):
# type: (StateCache, Optional[grpc.ChannelCredentials], Optional[str]) -> None
self._state_handler_cache = {} # type: Dict[str, CachingStateHandler]
self._lock = threading.Lock()
self._throwing_state_handler = ThrowingStateHandler()
Expand Down

0 comments on commit 1fe5190

Please sign in to comment.