Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-1251 Python 3 Support
  3. BEAM-6454

TypeError in DataflowRunner: dict_values does not support indexing

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.11.0
    • Component/s: sdk-py-harness
    • Labels:
      None

      Description

      In python 3, dict.values() returns a view, rather than a list. So need to wrap it to a list.

      Error in console output:

      ERROR:root:Error while visiting read/Read/Impulse
      Traceback (most recent call last):
        File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main
          "__main__", mod_spec)
        File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
          exec(code, run_globals)
        File "/usr/local/google/home/markliu/tmp/beam4/sdks/python/apache_beam/examples/wordcount.py", line 136, in <module>
          run()
        File "/usr/local/google/home/markliu/tmp/beam4/sdks/python/apache_beam/examples/wordcount.py", line 115, in run
          result = p.run()
        File "/usr/local/google/home/markliu/tmp/beam4/sdks/python/apache_beam/pipeline.py", line 405, in run
          self._options).run(False)
        File "/usr/local/google/home/markliu/tmp/beam4/sdks/python/apache_beam/pipeline.py", line 418, in run
          return self.runner.run_pipeline(self, self._options)
        File "/usr/local/google/home/markliu/tmp/beam4/sdks/python/apache_beam/runners/dataflow/dataflow_runner.py", line 367, in run_pipeline
          super(DataflowRunner, self).run_pipeline(pipeline, options)
        File "/usr/local/google/home/markliu/tmp/beam4/sdks/python/apache_beam/runners/runner.py", line 176, in run_pipeline
          pipeline.visit(RunVisitor(self))
        File "/usr/local/google/home/markliu/tmp/beam4/sdks/python/apache_beam/pipeline.py", line 446, in visit
          self._root_transform().visit(visitor, self, visited)
        File "/usr/local/google/home/markliu/tmp/beam4/sdks/python/apache_beam/pipeline.py", line 815, in visit
          part.visit(visitor, pipeline, visited)
        File "/usr/local/google/home/markliu/tmp/beam4/sdks/python/apache_beam/pipeline.py", line 815, in visit
          part.visit(visitor, pipeline, visited)
        File "/usr/local/google/home/markliu/tmp/beam4/sdks/python/apache_beam/pipeline.py", line 815, in visit
          part.visit(visitor, pipeline, visited)
        File "/usr/local/google/home/markliu/tmp/beam4/sdks/python/apache_beam/pipeline.py", line 818, in visit
          visitor.visit_transform(self)
        File "/usr/local/google/home/markliu/tmp/beam4/sdks/python/apache_beam/runners/runner.py", line 171, in visit_transform
          self.runner.run_transform(transform_node, options)
        File "/usr/local/google/home/markliu/tmp/beam4/sdks/python/apache_beam/runners/runner.py", line 214, in run_transform
          return m(transform_node, options)
        File "/usr/local/google/home/markliu/tmp/beam4/sdks/python/apache_beam/runners/dataflow/dataflow_runner.py", line 532, in run_Impulse
          step.encoding = self._get_encoded_output_coder(transform_node)
        File "/usr/local/google/home/markliu/tmp/beam4/sdks/python/apache_beam/runners/dataflow/dataflow_runner.py", line 461, in _get_encoded_output_coder
          transform_node.outputs.values()[0].pipeline._options)
      TypeError: 'dict_values' object does not support indexing
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                markflyhigh Mark Liu
                Reporter:
                markflyhigh Mark Liu
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m