shunping commented on code in PR #35137:
URL: https://github.com/apache/beam/pull/35137#discussion_r2150840718
##########
sdks/python/apache_beam/io/iobase.py:
##########
@@ -1126,12 +1167,13 @@ def __init__(self, sink: Sink) -> None:
super().__init__()
self.sink = sink
- def expand(self, pcoll):
+ def _expand_bounded(self, pcoll, min_shards):
+ """Handles the expansion logic for a bounded PCollection."""
do_once = pcoll.pipeline | 'DoOnce' >> core.Create([None])
init_result_coll = do_once | 'InitializeWrite' >> core.Map(
lambda _, sink: sink.initialize_write(), self.sink)
- if getattr(self.sink, 'num_shards', 0):
- min_shards = self.sink.num_shards
+
+ if (min_shards >= 1):
Review Comment:
Should this be ">" instead? Because min_shards is never 0 now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]