From bcc27776fa751e81d429d06d05711225812e68a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Swe=C3=B1a=20=28Swast=29?= Date: Fri, 29 Mar 2024 15:32:03 -0500 Subject: [PATCH 1/2] docs: `bigframes.options.bigquery.project` and `location` are optional in some circumstances --- samples/snippets/set_options_test.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/samples/snippets/set_options_test.py b/samples/snippets/set_options_test.py index ef6f41ce54..f981009e9a 100644 --- a/samples/snippets/set_options_test.py +++ b/samples/snippets/set_options_test.py @@ -26,7 +26,14 @@ def test_bigquery_dataframes_set_options(): REGION = "US" # @param {type:"string"} # Set BigQuery DataFrames options + # Note: The project option is not required in all environments. + # On BigQuery Studio, the project ID is automatically detected. bpd.options.bigquery.project = PROJECT_ID + + # Note: The location option is not required. + # It defaults to the location of the first table or query + # passed to read_gbq(). For APIs where a location can't be + # auto-detected, the location defaults to the "US" location. bpd.options.bigquery.location = REGION # [END bigquery_dataframes_set_options] From e3bd7bf91b36b3b24983a5db2aedc5200dee2a22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Swe=C3=B1a=20=28Swast=29?= Date: Fri, 29 Mar 2024 15:35:11 -0500 Subject: [PATCH 2/2] update quickstart too --- samples/snippets/quickstart.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/samples/snippets/quickstart.py b/samples/snippets/quickstart.py index a15ea16853..ae3a934004 100644 --- a/samples/snippets/quickstart.py +++ b/samples/snippets/quickstart.py @@ -29,8 +29,9 @@ def run_quickstart(project_id: str): import bigframes.pandas as bpd # Set BigQuery DataFrames options + # Note: The project option is not required in all environments. + # On BigQuery Studio, the project ID is automatically detected. bpd.options.bigquery.project = your_gcp_project_id - bpd.options.bigquery.location = "us" # Create a DataFrame from a BigQuery table query_or_table = "bigquery-public-data.ml_datasets.penguins"