kennknowles opened a new issue, #19154: URL: https://github.com/apache/beam/issues/19154
Consider the following pipeline: `with beam.Pipeline(..) as p: ` ` res = p | ... | beam.Partition(..)` When res is an `_apache_beam.pvalue.DoOutputsTuple_`, it supports access by `res[0]` and `res["0"]`. However, if res is a `_apache_beam.transforms.ptransform._MaterializedDoOutputsTuple_', integer access isn't supported and we must access as strings, although not very intuitive considering that `_partition_fn_` returns integers. I'm not familiar with beam internals but briefly looked into the code and I saw that __MaterializedDoOutputsTuple overrides the __getitem__() of DoOutputsTuple and doesn't have the explicit casting ([https://github.com/apache/beam/blob/master/sdks/python/apache_beam/pvalue.py#L225).](https://github.com/apache/beam/blob/master/sdks/python/apache_beam/pvalue.py#L225).) Also looks like [~gildea] already had a related comment there. Is this on purpose? Can I expect an access-by-int API for Partition() results regardless of whether it was materialized or not? Imported from Jira [BEAM-5805](https://issues.apache.org/jira/browse/BEAM-5805). Original Jira may contain additional context. Reported by: zachmoshe. -- 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]
