Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Ability to specify a location for the BigQuery magics %%bigquery requests #1760

@kolban-google

Description

@kolban-google

When using the BigQuery magics command, I am unable to specify a location where the query will be executed. When we look at the Cloud Console, we find that we can go into query settings > Advanced and set the location type (after unchecking "Automatic location selection"). By naming a region/multi region we can explicitly declare where the query should run.

Prior to now (2024-01) the ability to specify where the query should execute was likely not that interesting ... however, now we have the concept of Cross Region Dataset replication. This allows me to define a dataset and specify a named region where my dataset will be asynchronously replicated to. Effectively, I now have the dataset existing in MULTIPLE regions and, in that case, it makes sense to specify where I want my query to run.

I reviewed the magics code and believe the change would be relatively simple. Looking at the code I find

client = bigqueryClient(...)

and then reviewing here ... I see that location is a parameter of the Client() constructor. I get the feel that adding location as a parameter to Bigquery magics would not be too onerous.

I could imagine:

%%bigquery --location us-east1
SELECT * FROM X.Y;

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: bigqueryIssues related to the googleapis/python-bigquery API.good first issueThis issue is a good place to started contributing to this repository.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions