You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/09/08 16:08:48 UTC

[GitHub] [beam] ahmedabu98 commented on a diff in pull request #23070: Support TIMESTAMP type in BigQueryIO with BEAM_ROW output type, and in read_gbq

ahmedabu98 commented on code in PR #23070:
URL: https://github.com/apache/beam/pull/23070#discussion_r966150744


##########
sdks/python/apache_beam/io/gcp/bigquery_read_it_test.py:
##########
@@ -258,6 +258,18 @@ def test_table_schema_retrieve_with_direct_read(self):
               utype(id=4, name='customer2', type='test')
           ]))
 
+  @pytest.mark.it_postcommit
+  def test_table_schema_retrieve_with_timestamp(self):
+    with beam.Pipeline(argv=self.args) as p:
+      result = (
+          p | apache_beam.io.gcp.bigquery.ReadFromBigQuery(
+              gcs_location="gs://bqio_schema_test",
+              dataset="beam_bigquery_io_test",
+              table="taxi",
+              project="apache-beam-testing",
+              output_type='BEAM_ROW'))
+      assert_that(result, equal_to([]))

Review Comment:
   What is this testing for?



##########
sdks/python/apache_beam/io/gcp/bigquery_schema_tools.py:
##########
@@ -80,7 +82,7 @@ def bq_field_to_type(field, mode):
     return Optional[BIG_QUERY_TO_PYTHON_TYPES[field]]
   elif mode == 'REPEATED':
     return Sequence[BIG_QUERY_TO_PYTHON_TYPES[field]]
-  elif mode is None or mode == '':
+  elif mode is None or mode == '' or mode == 'REQUIRED':

Review Comment:
   If mode isn't provided, we should [default to `NULLABLE` mode](https://developers.google.com/resources/api-libraries/documentation/bigquery/v2/java/latest/com/google/api/services/bigquery/model/TableFieldSchema.html#setMode-java.lang.String-) to stay consistent. WDYT?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org