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

Example 'JsonCoder' object has no attribute 'to_type_hint'

Details

    • Bug
    • Status: Resolved
    • P1
    • Resolution: Fixed
    • None
    • 2.39.0
    • examples-python
    • None

    Description

      This test wasn't running due to BEAM-14336, I'm not sure it ever ran successfully. It is a hard failure in beam_PostCommit_Python_Examples_Dataflow apache_beam.examples.cookbook.coders_it_test.CodersIT.test_coders_output_files_on_small_input:
      https://ci-beam.apache.org/job/beam_PostCommit_Python_Examples_Dataflow/293/testReport/junit/apache_beam.examples.cookbook.coders_it_test/CodersIT/test_coders_output_files_on_small_input/

      self = <apache_beam.examples.cookbook.coders_it_test.CodersIT testMethod=test_coders_output_files_on_small_input>
      
          @pytest.mark.no_xdist
          @pytest.mark.examples_postcommit
          def test_coders_output_files_on_small_input(self):
            test_pipeline = TestPipeline(is_integration_test=True)
            # Setup the files with expected content.
            OUTPUT_FILE_DIR = \
                'gs://temp-storage-for-end-to-end-tests/py-it-cloud/output'
            output = '/'.join([OUTPUT_FILE_DIR, str(uuid.uuid4()), 'result'])
            INPUT_FILE_DIR = \
                'gs://temp-storage-for-end-to-end-tests/py-it-cloud/input'
            input = '/'.join([INPUT_FILE_DIR, str(uuid.uuid4()), 'input.txt'])
            create_content_input_file(
                input, '\n'.join(map(json.dumps, self.SAMPLE_RECORDS)))
            extra_opts = {'input': input, 'output': output}
      >     coders.run(test_pipeline.get_full_options_as_args(**extra_opts))
      
      apache_beam/examples/cookbook/coders_it_test.py:93: 
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
      apache_beam/examples/cookbook/coders.py:87: in run
          p
      apache_beam/transforms/ptransform.py:1092: in __ror__
          return self.transform.__ror__(pvalueish, self.label)
      apache_beam/transforms/ptransform.py:614: in __ror__
          result = p.apply(self, pvalueish, label)
      apache_beam/pipeline.py:662: in apply
          return self.apply(transform, pvalueish)
      apache_beam/pipeline.py:708: in apply
          pvalueish_result = self.runner.apply(transform, pvalueish, self._options)
      apache_beam/runners/dataflow/dataflow_runner.py:141: in apply
          return super().apply(transform, input, options)
      apache_beam/runners/runner.py:185: in apply
          return m(transform, input, options)
      apache_beam/runners/runner.py:215: in apply_PTransform
          return transform.expand(input)
      apache_beam/io/textio.py:690: in expand
          self._source.output_type_hint())
      _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
      
      self = <apache_beam.io.textio._TextSource object at 0x7fef4d8071c0>
      
          def output_type_hint(self):
            try:
      >       return self._coder.to_type_hint()
      E       AttributeError: 'JsonCoder' object has no attribute 'to_type_hint'
      
      apache_beam/io/textio.py:409: AttributeError
      

      cc: Valentyn Tymofieiev

      Attachments

        Activity

          People

            robertwb Robert Bradshaw
            apilloud Andrew Pilloud
            Votes:
            0 Vote for this issue
            Watchers:
            3 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 - 1h
                1h

                Slack

                  Issue deployment