8000 docs: include the clean-up step in the udf code snippet by shobsi · Pull Request #1698 · googleapis/python-bigquery-dataframes · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions samples/snippets/udf.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,9 @@ 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
)
session.bqclient.delete_routine(f"{your_bq_dataset_id}.{your_bq_routine_id}")

# [END bigquery_dataframes_udf]
0