-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Request to use BASIC enum when calling tables.get() in BigQuery #34075 #34249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
92109dc
294f23e
638ba4f
95bf0c4
1c0da8d
96f8848
c196ee2
dc57f7e
93a4501
383c901
b1eb334
dcea2ab
85b9347
b505946
47ee407
64deda3
c57a248
9f55841
73723b6
654265a
6f25b9f
ab38977
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -66,6 +66,7 @@ | |||
| from apache_beam.typehints.typehints import Any | ||||
| from apache_beam.utils import retry | ||||
| from apache_beam.utils.histogram import LinearBucket | ||||
| from apache_beam.io.gcp.internal.clients.bigquery.bigquery_v2_messages import BigqueryTablesGetRequest | ||||
|
|
||||
| # Protect against environments where bigquery library is not available. | ||||
| # pylint: disable=wrong-import-order, wrong-import-position | ||||
|
|
@@ -772,22 +773,28 @@ def _insert_all_rows( | |||
| @retry.with_exponential_backoff( | ||||
| num_retries=MAX_RETRIES, | ||||
| retry_filter=retry.retry_on_server_errors_timeout_or_quota_issues_filter) | ||||
| def get_table(self, project_id, dataset_id, table_id): | ||||
| def get_table( | ||||
| self, | ||||
| project_id, | ||||
| dataset_id, | ||||
| table_id, | ||||
| view=BigqueryTablesGetRequest.ViewValueValuesEnum.BASIC): | ||||
| """Lookup a table's metadata object. | ||||
|
|
||||
| Args: | ||||
| client: bigquery.BigqueryV2 instance | ||||
| project_id: table lookup parameter | ||||
| dataset_id: table lookup parameter | ||||
| table_id: table lookup parameter | ||||
| view: table information parameter | ||||
|
|
||||
| Returns: | ||||
| bigquery.Table instance | ||||
| Raises: | ||||
| HttpError: if lookup failed. | ||||
| """ | ||||
| request = bigquery.BigqueryTablesGetRequest( | ||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please check beam/sdks/python/apache_beam/io/gcp/internal/clients/bigquery/bigquery_v2_messages.py Line 929 in a45b0df
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @liferoad should I replace line 792 with it with view= _messages.enumfield() ?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You need define view in BigqueryTablesGetRequest
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ack, added in commit 93a4501679f23699230906af5f339b64eec866b2 |
||||
| projectId=project_id, datasetId=dataset_id, tableId=table_id) | ||||
| projectId=project_id, datasetId=dataset_id, tableId=table_id, view=view) | ||||
| response = self.client.tables.Get(request) | ||||
| return response | ||||
|
|
||||
|
|
||||
Uh oh!
There was an error while loading. Please reload this page.