Skip to content

Commit 48992e2

Browse files
docs: include the clean-up step in the udf code snippet (#1698)
* docs: include the clean-up step in the udf code snippet * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent b16740e commit 48992e2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

samples/snippets/udf.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,9 @@ def get_hash(input: str) -> str:
112112
df_redacted = df[["species", "island", "sex"]].map(get_hash)
113113
df_redacted.peek(10)
114114

115-
# [END bigquery_dataframes_udf]
116-
117-
# Clean up cloud artifacts
115+
# If the BigQuery routine is no longer needed, we can clean it up
116+
# to free up any cloud quota
118117
session = bpd.get_global_session()
119-
session.bqclient.delete_routine(
120-
f"{your_bq_dataset_id}.{your_bq_routine_id}", not_found_ok=True
121-
)
118+
session.bqclient.delete_routine(f"{your_bq_dataset_id}.{your_bq_routine_id}")
119+
120+
# [END bigquery_dataframes_udf]

0 commit comments

Comments
 (0)