specify geographical location of table in pandas read_gbq
See original GitHub issueI am having trouble setting the geographical location in pandas.read_gbq.
In google.cloud.bigquery I can set the location to asia-northeast1 the following:
from google.cloud import bigquery
bigquery_client = bigquery.Client(project_name)
query_job = bigquery_client.query(query, location='asia-northeast1')
However, I fail to do this in read_gbq. The following seems not to work:
from pandas_gbq import gbq
dat = gbq.read_gbq(query, project_id=project_name, jobReference={'location':'asia-northeast1'}, dialect='standard')
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5 (1 by maintainers)
Top Results From Across the Web
specify geographical location of table in pandas read_gbq
I am having trouble setting the geographical location in pandas.read_gbq . In google.cloud.bigquery I can set the location to ...
Read more >specify geographical location of table in pandas read_gbq #177
I am having trouble setting the geographical location in pandas.read_gbq. In google.cloud.bigquery I can set the location to asia-northeast1 ...
Read more >pandas.read_gbq — pandas 1.5.2 documentation
See the BigQuery locations documentation for a list of available locations. The location must match that of any datasets used in the query....
Read more >Comparison with pandas-gbq | BigQuery - Google Cloud
Note: The pandas.read_gbq method defaults to legacy SQL. ... as running a parameterized query or specifying a destination table to store the query...
Read more >Reading Tables — pandas-gbq 0.14.1+1.g97c9aaa ...
Use the pandas_gbq.read_gbq() function to run a BigQuery query and download the results as a pandas.DataFrame object. import pandas_gbq # TODO: Set ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I think the proper fix here is to add a
locationparameter toread_gbqandto_gbqso that we can pass it on to thegoogle-cloud-bigquerylibrary when we run the query or load job.Aside: I’d like to make this less verbose once there is a way to set a default location in the BigQuery client object. https://github.com/GoogleCloudPlatform/google-cloud-python/issues/5148
Version 0.5.0 is now released to PyPI with this fix. Next steps are to add the location parameters to Pandas.