gemini-code-assist[bot] commented on code in PR #35754:
URL: https://github.com/apache/beam/pull/35754#discussion_r2245988234
##########
sdks/python/apache_beam/pvalue.py:
##########
@@ -254,6 +254,9 @@ def __init__(
# Dictionary of PCollections already associated with tags.
self._pcolls: Dict[Optional[str], PCollection] = {}
+ def __or__(self, other):
+ return self[self._main_tag].__or__(other)
Review Comment:

This `print` statement appears to be for debugging purposes and should be
removed before merging.
##########
sdks/python/apache_beam/typehints/typed_pipeline_test.py:
##########
@@ -239,6 +239,27 @@ def process(self, element):
with self.assertRaises(ValueError):
_ = res['undeclared tag']
+ def test_typed_dofn_multi_output_default_main(self):
+ """
+ Test that the main pcollection of a multi-output pcoll pardo
+ is used by default when a PTransform is applied to it.
+ """
+ class NoEvenTagMyDoFn(beam.DoFn):
+ def process(self, element):
+ if element % 2:
+ yield beam.pvalue.TaggedOutput('odd', element)
+ else:
+ yield element
+
+ with beam.Pipeline() as p:
+ res = (
+ p
+ | beam.Create([1, 2, 3])
+ | beam.ParDo(NoEvenTagMyDoFn(tag_even=False)).with_outputs('odd'))
Review Comment:

The `NoEvenTagMyDoFn` does not have an `__init__` method that accepts a
`tag_even` argument. While this doesn't cause an error due to the base `DoFn`'s
`__init__`, it's misleading and should be removed for clarity.
```suggestion
| beam.ParDo(NoEvenTagMyDoFn()).with_outputs('odd'))
```
--
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]