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

Reading None value type BYTES from bigquery: AttributeError

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.14.0
    • Component/s: sdk-py-core
    • Labels:
      None

      Description

      When reading bigquery data where a field of type BYTES contains a None value I get the following error:

      Traceback (most recent call last): File "/mnt/c/Users/Juta/Documents/02-projects/apache/beam/sdks/venv/lib/python3.5/site-packages/apache_beam/runners/direct/executor.py", line 343, in call finish_state) File "/mnt/c/Users/Juta/Documents/02-projects/apache/beam/sdks/venv/lib/python3.5/site-packages/apache_beam/runners/direct/executor.py", line 383, in attempt_call result = evaluator.finish_bundle() File "/mnt/c/Users/Juta/Documents/02-projects/apache/beam/sdks/venv/lib/python3.5/site-packages/apache_beam/runners/direct/transform_evaluator.py", line 319, in finish_bundle bundles = _read_values_to_bundles(reader) File "/mnt/c/Users/Juta/Documents/02-projects/apache/beam/sdks/venv/lib/python3.5/site-packages/apache_beam/runners/direct/transform_evaluator.py", line 306, in _read_values_to_bundles read_result = [GlobalWindows.windowed_value(e) for e in reader] File "/mnt/c/Users/Juta/Documents/02-projects/apache/beam/sdks/venv/lib/python3.5/site-packages/apache_beam/runners/direct/transform_evaluator.py", line 306, in <listcomp> read_result = [GlobalWindows.windowed_value(e) for e in reader] File "/mnt/c/Users/Juta/Documents/02-projects/apache/beam/sdks/venv/lib/python3.5/site-packages/apache_beam/io/gcp/bigquery_tools.py", line 932, in __iter__ row.f[i].v.string_value = row.f[i].v.string_value.encode('utf-8') AttributeError: 'NoneType' object has no attribute 'string_value'

      This bug was introduced in https://github.com/apache/beam/pull/8621 and is present in the 2.13 release.
      I submitted a pr to fix the issue: https://github.com/apache/beam/pull/8817

        Attachments

          Activity

            People

            • Assignee:
              Juta Juta Staes
              Reporter:
              Juta Juta Staes
            • 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 - 7h 40m
                7h 40m