Skip to content

Commit e4b400b

Browse files
authored
Minor: Fix Iterable[SplitResultResidual] type errors (#15634)
* Fix Iterable[SplitResultResidual] type errors * fixup! Fix Iterable[SplitResultResidual] type errors
1 parent 190e947 commit e4b400b

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

sdks/python/apache_beam/runners/common.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -567,9 +567,10 @@ def invoke_process(self,
567567
additional_args=None,
568568
additional_kwargs=None
569569
):
570-
# type: (...) -> None
570+
# type: (...) -> Iterable[SplitResultResidual]
571571
self.output_processor.process_outputs(
572572
windowed_value, self.process_method(windowed_value.value))
573+
return []
573574

574575

575576
class PerWindowInvoker(DoFnInvoker):

sdks/python/apache_beam/runners/worker/operations.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -710,13 +710,12 @@ def start(self):
710710
def process(self, o):
711711
# type: (WindowedValue) -> None
712712
with self.scoped_process_state:
713-
delayed_application = self.dofn_runner.process(o)
714-
if delayed_application:
713+
delayed_applications = self.dofn_runner.process(o)
714+
if delayed_applications:
715715
assert self.execution_context is not None
716-
# TODO(BEAM-77746): there's disagreement between subclasses
717-
# of DoFnRunner over the return type annotations of process().
718-
self.execution_context.delayed_applications.append(
719-
(self, delayed_application)) # type: ignore[arg-type]
716+
for delayed_application in delayed_applications:
717+
self.execution_context.delayed_applications.append(
718+
(self, delayed_application))
720719

721720
def finalize_bundle(self):
722721
# type: () -> None

0 commit comments

Comments
 (0)