[
https://issues.apache.org/jira/browse/BEAM-11587?focusedWorklogId=764312&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-764312
]
ASF GitHub Bot logged work on BEAM-11587:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 29/Apr/22 15:50
Start Date: 29/Apr/22 15:50
Worklog Time Spent: 10m
Work Description: 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
Issue Time Tracking
-------------------
Worklog Id: (was: 764312)
Time Spent: 5h (was: 4h 50m)
> Support pd.read_gbq and DataFrame.to_gbq
> ----------------------------------------
>
> Key: BEAM-11587
> URL: https://issues.apache.org/jira/browse/BEAM-11587
> Project: Beam
> Issue Type: New Feature
> Components: dsl-dataframe, io-py-gcp, sdk-py-core
> Reporter: Brian Hulette
> Assignee: Svetak Vihaan Sundhar
> Priority: P3
> Labels: dataframe-api
> Time Spent: 5h
> Remaining Estimate: 0h
>
> We should support
> [read_gbq|https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_gbq.html]
> andÂ
> [to_gbq|https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_gbq.html]
> in the DataFrame API when gcp extras are installed.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)