Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-12234

README example for Beam Python InteractiveRunner is broken

Details

    • Bug
    • Status: Triage Needed
    • P3
    • Resolution: Unresolved
    • 2.28.0
    • None
    • runner-py-interactive
    • None

    Description

      Running the example from the interactive Beam README doc [1] produces an error:

      import apache_beam as beam
      from apache_beam.runners.interactive.interactive_runner import InteractiveRunner
      
      p = beam.Pipeline(InteractiveRunner())
      pcoll = p | beam.Create([1, 2, 3])
      result = p.run().wait_until_finish()
      pcoll_list = result.get(pcoll)  # This returns a list!
      

      Results in:

      ---------------------------------------------------------------------------
      AttributeError                            Traceback (most recent call last)
      <ipython-input-11-b3606ce83458> in <module>()
            2 pcoll = p | beam.Create([1, 2, 3])
            3 result = p.run().wait_until_finish()
      ----> 4 pcoll_list = result.get(pcoll)  # This returns a list!
      
      AttributeError: 'NoneType' object has no attribute 'get'
      

      Side note: I had to look-up the import statements here. As long as you're updating the example, it would be nice for it to be runnable with copy & paste.

      [1] https://github.com/apache/beam/blob/master/sdks/python/apache_beam/runners/interactive/README.md 

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            shoyer Stephan Hoyer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: