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/23 16:27:03 UTC

[GitHub] [beam] KevinGG commented on issue #20874: Python InteractiveRunner works when evaluated as a global but not in a function

KevinGG commented on issue #20874:
URL: https://github.com/apache/beam/issues/20874#issuecomment-1164624112

   This is intended behavior.
   
   When a pipeline is not defined in the `__main__` module, it's not known by Beam to do any magic for it because it's local.
   To make it work inside non-main modules/scopes, add `ib.watch(locals())` or `ib.watch({'pipeline_name': pipeline, 'pcoll_name': pcoll})` to notify Beam to watch them.
   
   And use `ib.collect` and `ib.show` instead of the `result = p.run()` + `result.get(pcoll)` pattern because you don't need to run the whole pipeline to materialize a single pcollection.


-- 
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

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