stankiewicz commented on code in PR #34135:
URL: https://github.com/apache/beam/pull/34135#discussion_r1979295848
##########
sdks/python/apache_beam/io/gcp/bigquery_tools.py:
##########
@@ -417,66 +441,61 @@ def _get_temp_dataset(self):
return self.temp_table_ref.datasetId
return BigQueryWrapper.TEMP_DATASET + self._temporary_table_suffix
- @retry.with_exponential_backoff(
- num_retries=MAX_RETRIES,
- retry_filter=retry.retry_on_server_errors_and_timeout_filter)
- def get_query_location(self, project_id, query, use_legacy_sql):
- """
- Get the location of tables referenced in a query.
-
- This method returns the location of the first available referenced
- table for user in the query and depends on the BigQuery service to
- provide error handling for queries that reference tables in multiple
- locations.
- """
- reference = bigquery.JobReference(
- jobId=uuid.uuid4().hex, projectId=project_id)
- request = bigquery.BigqueryJobsInsertRequest(
- projectId=project_id,
- job=bigquery.Job(
- configuration=bigquery.JobConfiguration(
- dryRun=True,
- query=bigquery.JobConfigurationQuery(
- query=query,
- useLegacySql=use_legacy_sql,
- )),
- jobReference=reference))
-
- response = self.client.jobs.Insert(request)
-
- if response.statistics is None:
- # This behavior is only expected in tests
- _LOGGER.warning(
- "Unable to get location, missing response.statistics. Query: %s",
- query)
- return None
+ def get_table(self, project_id, dataset_id, table_id):
Review Comment:
it's up to you, thanks!
--
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]