Skip to content

Commit 6e6a40c

Browse files
committed
[Python] Preserve BoundedSource boundedness in Read serialization
Restore the is_bounded() conditional on the BoundedSource branch of Read.to_runner_api_parameter so a source that reports unbounded keeps serializing as UNBOUNDED.
1 parent 99e3cd0 commit 6e6a40c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

sdks/python/apache_beam/io/iobase.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,9 @@ def to_runner_api_parameter(
998998
common_urns.deprecated_primitives.READ.urn,
999999
beam_runner_api_pb2.ReadPayload(
10001000
source=self.source.to_runner_api(context),
1001-
is_bounded=beam_runner_api_pb2.IsBounded.BOUNDED))
1001+
is_bounded=beam_runner_api_pb2.IsBounded.BOUNDED
1002+
if self.source.is_bounded() else
1003+
beam_runner_api_pb2.IsBounded.UNBOUNDED))
10021004
# Local import to avoid a circular dependency.
10031005
from apache_beam.io.unbounded_source import UnboundedSource
10041006
if isinstance(self.source, UnboundedSource):

0 commit comments

Comments
 (0)