Skip to content

Commit 90bcec5

Browse files
authored
docs: bigframes.options.bigquery.project and location are optional in some circumstances (#548)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://togithub.com/googleapis/python-bigquery-dataframes/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Follow-up to launch feedback and https://togithub.com/googleapis/python-bigquery-dataframes/pull/451 🦕
1 parent b188146 commit 90bcec5

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

samples/snippets/quickstart.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ def run_quickstart(project_id: str):
2929
import bigframes.pandas as bpd
3030

3131
# Set BigQuery DataFrames options
32+
# Note: The project option is not required in all environments.
33+
# On BigQuery Studio, the project ID is automatically detected.
3234
bpd.options.bigquery.project = your_gcp_project_id
33-
bpd.options.bigquery.location = "us"
3435

3536
# Create a DataFrame from a BigQuery table
3637
query_or_table = "bigquery-public-data.ml_datasets.penguins"

samples/snippets/set_options_test.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,14 @@ def test_bigquery_dataframes_set_options():
2626
REGION = "US" # @param {type:"string"}
2727

2828
# Set BigQuery DataFrames options
29+
# Note: The project option is not required in all environments.
30+
# On BigQuery Studio, the project ID is automatically detected.
2931
bpd.options.bigquery.project = PROJECT_ID
32+
33+
# Note: The location option is not required.
34+
# It defaults to the location of the first table or query
35+
# passed to read_gbq(). For APIs where a location can't be
36+
# auto-detected, the location defaults to the "US" location.
3037
bpd.options.bigquery.location = REGION
3138

3239
# [END bigquery_dataframes_set_options]

0 commit comments

Comments
 (0)