[ https://issues.apache.org/jira/browse/BEAM-6909?focusedWorklogId=219720&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-219720 ]
ASF GitHub Bot logged work on BEAM-6909: ---------------------------------------- Author: ASF GitHub Bot Created on: 27/Mar/19 23:56 Start Date: 27/Mar/19 23:56 Worklog Time Spent: 10m Work Description: ryanyuan commented on pull request #8139: [BEAM-6909] Add location support for BigQueryWrapper._get_query_resul… URL: https://github.com/apache/beam/pull/8139#discussion_r269815268 ########## File path: sdks/python/apache_beam/io/gcp/bigquery_tools.py ########## @@ -347,16 +347,21 @@ def _start_query_job(self, project_id, query, use_legacy_sql, flatten_results, jobReference=reference)) response = self.client.jobs.Insert(request) - return response.jobReference.jobId + return response.jobReference.jobId, response.jobReference.location @retry.with_exponential_backoff( num_retries=MAX_RETRIES, retry_filter=retry.retry_on_server_errors_and_timeout_filter) def _get_query_results(self, project_id, job_id, - page_token=None, max_results=10000): - request = bigquery.BigqueryJobsGetQueryResultsRequest( - jobId=job_id, pageToken=page_token, projectId=project_id, - maxResults=max_results) + page_token=None, max_results=10000, location=None): + if location: + request = bigquery.BigqueryJobsGetQueryResultsRequest( + jobId=job_id, pageToken=page_token, projectId=project_id, + maxResults=max_results, location=location) + else: + request = bigquery.BigqueryJobsGetQueryResultsRequest( + jobId=job_id, pageToken=page_token, projectId=project_id, + maxResults=max_results) Review comment: @pabloem Yeah you are right. Thanks for the suggestion! ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 219720) Time Spent: 2.5h (was: 2h 20m) > Add location support for BigQueryWrapper._get_query_results() > ------------------------------------------------------------- > > Key: BEAM-6909 > URL: https://issues.apache.org/jira/browse/BEAM-6909 > Project: Beam > Issue Type: Bug > Components: sdk-py-core > Reporter: Ryan Yuan > Priority: Critical > Time Spent: 2.5h > Remaining Estimate: 0h > > When a BQ Job is created outside US or EU, the _get_query_results() in > bigquery_tools.py always return 404. > > This is to patch the _get_query_results() so that it can support location as > parameter. -- This message was sent by Atlassian JIRA (v7.6.3#76005)