TheNeuralBit commented on code in PR #17159:
URL: https://github.com/apache/beam/pull/17159#discussion_r861932974
##########
sdks/python/apache_beam/io/gcp/bigquery_test.py:
##########
@@ -482,6 +482,37 @@ def test_temp_dataset_is_configurable(
delete_table.assert_called_with(
temp_dataset.projectId, temp_dataset.datasetId, mock.ANY)
+ def test_retrieve_table_schema(self, *args):
+ the_table =
beam.io.gcp.bigquery.bigquery_tools.BigQueryWrapper().get_table(
+ project_id="apache-beam-testing",
+ dataset_id="beam_bigquery_io_test",
+ table_id="taxi")
+ table = the_table.schema
+ schema = beam.io.gcp.internal.clients.bigquery.TableSchema(
+ fields=[
+ beam.io.gcp.internal.clients.bigquery.TableFieldSchema(
+ name="event_timestamp", type="TIMESTAMP", mode="REQUIRED"),
+ beam.io.gcp.internal.clients.bigquery.TableFieldSchema(
+ name="ride_id", type="STRING"),
+ beam.io.gcp.internal.clients.bigquery.TableFieldSchema(
+ name="point_idx", type="INTEGER"),
+ beam.io.gcp.internal.clients.bigquery.TableFieldSchema(
+ name="latitude", type="FLOAT"),
+ beam.io.gcp.internal.clients.bigquery.TableFieldSchema(
+ name="timestamp", type="STRING"),
+ beam.io.gcp.internal.clients.bigquery.TableFieldSchema(
+ name="meter_reading", type="FLOAT"),
+ beam.io.gcp.internal.clients.bigquery.TableFieldSchema(
+ name="meter_increment", type="FLOAT"),
+ beam.io.gcp.internal.clients.bigquery.TableFieldSchema(
+ name="ride_status", type="STRING"),
+ beam.io.gcp.internal.clients.bigquery.TableFieldSchema(
+ name="passenger_count", type="INTEGER"),
+ beam.io.gcp.internal.clients.bigquery.TableFieldSchema(
+ name="longitude", type="FLOAT")
+ ])
+ self.assertEqual(table, schema)
Review Comment:
Could you clarify what this test is verifying? It doesn't seem to exercise
the code you're adding in this PR
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]