From e8ebef02da5a1743ee0c24bbaf76c048e1bc59ba Mon Sep 17 00:00:00 2001 From: Shobhit Singh Date: Tue, 6 May 2025 13:56:39 -0700 Subject: [PATCH 1/2] docs: include the clean-up step in the udf code snippet --- samples/snippets/udf.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/samples/snippets/udf.py b/samples/snippets/udf.py index 495cd33e84..3be7bd4ef5 100644 --- a/samples/snippets/udf.py +++ b/samples/snippets/udf.py @@ -112,10 +112,11 @@ def get_hash(input: str) -> str: df_redacted = df[["species", "island", "sex"]].map(get_hash) df_redacted.peek(10) - # [END bigquery_dataframes_udf] - - # Clean up cloud artifacts + # If the BigQuery routine is no longer needed, we can clean it up + # to free up any cloud quota session = bpd.get_global_session() session.bqclient.delete_routine( - f"{your_bq_dataset_id}.{your_bq_routine_id}", not_found_ok=True + f"{your_bq_dataset_id}.{your_bq_routine_id}" ) + + # [END bigquery_dataframes_udf] From 90d689da5737571d885e82ab908740a3f3827d79 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Tue, 6 May 2025 20:59:03 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A6=89=20Updates=20from=20OwlBot=20po?= =?UTF-8?q?st-processor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --- samples/snippets/udf.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/samples/snippets/udf.py b/samples/snippets/udf.py index 3be7bd4ef5..5f7ad8a33f 100644 --- a/samples/snippets/udf.py +++ b/samples/snippets/udf.py @@ -115,8 +115,6 @@ def get_hash(input: str) -> str: # If the BigQuery routine is no longer needed, we can clean it up # to free up any cloud quota session = bpd.get_global_session() - session.bqclient.delete_routine( - f"{your_bq_dataset_id}.{your_bq_routine_id}" - ) + session.bqclient.delete_routine(f"{your_bq_dataset_id}.{your_bq_routine_id}") # [END bigquery_dataframes_udf]