Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Create View Error: Cannot read and write in different locations

Hello,

Create view statement works when executed through BigQuery UI, but it fails when executed through Python client. Below is the error:

Cannot read and write in different locations: source: us-east1, destination: US

Please advise.

0 4 1,053
4 REPLIES 4

Hello @nodir 

Can you also specify from where you are executing python code?

@VishalBulbule , from my local machine which is in neither of the above locations. I tried setting BigQuery python client location to us-east1 and US, but no luck.

@nodir 

Can you confirm that dataset that contains your view and dataset that contains table used in your query to create view are in same location?

@VishalBulbule yes, the table and the view I'm trying to create are under the same dataset. 

The strange thing is: it works when created using UI, but fails when creating using Python SDK.