You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/06/04 12:40:16 UTC

[GitHub] [beam] damccorm opened a new issue, #19675: Python API: PTransform should be immutable and reusable

damccorm opened a new issue, #19675:
URL: https://github.com/apache/beam/issues/19675

   While the Java API seems fine the Python API is (at least) counterintuitive.
   
   Let's see the following example:
   ```
   
   p1 = beam.Pipeline()
   p2 = beam.Pipeline()
   node = 'ReadTrainData' >> beam.io.ReadFromText("/tmp/aaa.txt")
   p1
   | node 
   p2 | node //fails here 
   ```
   
   The code above will fail because the _node_ somehow remembers that it was already attached to _p1_. In fact, unlike in Java, the | (apply) method is defined on the _PTransform_.
   
   If any, only the pipeline object should be mutable here.
   
   Imported from Jira [BEAM-8140](https://issues.apache.org/jira/browse/BEAM-8140). Original Jira may contain additional context.
   Reported by: chris_suchanek.


-- 
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: github-unsubscribe@beam.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org