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

BigQuery IO does not support bytes in Python 3

    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.14.0
    • Component/s: sdk-py-core
    • Labels:
      None

      Description

      In Python 2 you could write bytes data to BigQuery. This is tested in
      https://github.com/apache/beam/blob/master/sdks/python/apache_beam/io/gcp/big_query_query_to_table_it_test.py#L186

      Python 3 does not support

      json.dumps({'test': b'test'})

      which is used to encode the data in
      https://github.com/apache/beam/blob/master/sdks/python/apache_beam/io/gcp/bigquery_tools.py#L959

       

      How should writing bytes to BigQuery be handled in Python 3?

      • Forbid writing bytes into BigQuery on Python 3
      • Guess the encoding (utf-8?)
      • Pass the encoding to BigQuery

      cc: Valentyn Tymofieiev

        Attachments

          Activity

            People

            • Assignee:
              Juta Juta Staes
              Reporter:
              Juta Juta Staes
            • Votes:
              0 Vote for this issue
              Watchers:
              4 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 - 20h 50m
                20h 50m