@@ -59,12 +59,11 @@ def poll(prefix) -> PollResult[str]:
5959import inspect
6060import time
6161import typing
62+ from collections .abc import Iterable
6263from typing import Any
6364from typing import Callable
6465from typing import Generic
65- from typing import Iterable
6666from typing import Optional
67- from typing import Tuple
6867from typing import TypeVar
6968
7069from apache_beam import coders
@@ -111,15 +110,15 @@ class PollResult(Generic[OutputT]):
111110 The ``OutputT`` type parameter can annotate a poll function's return type,
112111 as in ``-> PollResult[str]``; the transform infers the output coder from it.
113112 """
114- outputs : Tuple [TimestampedValue , ...]
113+ outputs : tuple [TimestampedValue , ...]
115114 watermark : Optional [Timestamp ] = None
116115
117116 @property
118117 def is_complete (self ) -> bool :
119118 return self .watermark == MAX_TIMESTAMP
120119
121120 @staticmethod
122- def _normalize (outputs , timestamp ) -> Tuple [TimestampedValue , ...]:
121+ def _normalize (outputs , timestamp ) -> tuple [TimestampedValue , ...]:
123122 if timestamp is None :
124123 default_ts = Timestamp .now ()
125124 else :
@@ -428,7 +427,7 @@ def _hash(self, value: Any) -> bytes:
428427 def current_restriction (self ) -> _GrowthState :
429428 return self ._restriction
430429
431- def try_claim (self , position : Tuple [PollResult , Any ]) -> bool :
430+ def try_claim (self , position : tuple [PollResult , Any ]) -> bool :
432431 """Claims one poll round; at most one claim succeeds per ``process()``.
433432
434433 The claim is rejected after a checkpoint already stopped this invocation,
@@ -723,7 +722,7 @@ def expand(self, pcoll):
723722 output_coder ,
724723 key_fn ,
725724 key_coder ,
726- self ._now )).with_output_types (Tuple [input_type , value_type ])
725+ self ._now )).with_output_types (tuple [input_type , value_type ])
727726
728727
729728def _as_duration (value ) -> Duration :
0 commit comments