question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

specify geographical location of table in pandas read_gbq

See original GitHub issue

I 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:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
tswastcommented, May 7, 2018

I think the proper fix here is to add a location parameter to read_gbq and to_gbq so that we can pass it on to the google-cloud-bigquery library 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

0reactions
tswastcommented, Jun 15, 2018

Version 0.5.0 is now released to PyPI with this fix. Next steps are to add the location parameters to Pandas.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found