Skip to content

feat(bigquery): add bigquery_drop_procedure sample to drop a SQL stor… - #14734

Merged
iennae merged 1 commit into
mainfrom
feat/bq-drop-procedure
Nov 4, 2026
Merged

iennae merged 1 commit into
mainfrom
feat/bq-drop-procedure

Conversation

@iennae

@iennae iennae commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

…ed procedure

Problem:
The BigQuery documentation (https://cloud.google.com/bigquery/docs/procedures) needs a standalone, tested Python code sample demonstrating how to drop a SQL stored procedure (region tag bigquery_drop_procedure).

Solution:

  • Add drop_procedure(project_id: str, dataset_id: str, procedure_id: str) -> None in bigquery/stored_procedures/bigquery_drop_procedure.py (Delete an existing SQL stored procedure from a BigQuery dataset using DROP PROCEDURE IF EXISTS.)
  • Add unit tests (bigquery/stored_procedures/bigquery_drop_procedure_test.py) covering both the success path and API error handling (GoogleAPICallError)

Description

Fixes #

Checklist

Testing

  • I have tested this change on a live environment and verified it works as intended.

Compliance & Style


Post-Approval Actions

  • Please merge this PR for me once it is approved

@iennae
iennae requested review from a team and chalmerlowe as code owners November 2, 2026 23:22
@product-auto-label product-auto-label Bot added the api: bigquery Issues related to the BigQuery API. label Nov 2, 2026
@snippet-bot

snippet-bot Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Here is the summary of changes.

You are about to add 1 region tag.

This comment is generated by snippet-bot.
If you find problems with this result, please file an issue at:
https://github.com/googleapis/repo-automation-bots/issues.
To update this comment, add snippet-bot:force-run label or use the checkbox below:

  • Refresh this comment

@product-auto-label product-auto-label Bot added the samples Issues that are directly related to samples. label Nov 2, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new Python sample and associated tests for dropping a BigQuery stored procedure. Feedback on the implementation includes correcting a misleading error message in the NotFound exception handler, as DROP PROCEDURE IF EXISTS will only raise this exception if the dataset or project is missing, not the procedure itself. Additionally, the test configuration in noxfile_config.py should be updated to ignore intermediate Python versions (3.11 and 3.12) to align with the policy of only testing the oldest and newest supported releases.

@iennae
iennae force-pushed the feat/bq-drop-procedure branch 2 times, most recently from be11a3e to 993886a Compare November 3, 2026 02:44

@XrossFox XrossFox left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, mock for failing test could swap where exception is raised to mock_client.result.

…ed procedure

Problem:
The BigQuery documentation (https://cloud.google.com/bigquery/docs/procedures)
needs a standalone, tested Python code sample demonstrating how to
drop a SQL stored procedure (region tag `bigquery_drop_procedure`).

Solution:
- Add `drop_procedure(project_id: str, dataset_id: str, procedure_id: str) -> None` in `bigquery/stored_procedures/bigquery_drop_procedure.py`
  (Delete an existing SQL stored procedure from a BigQuery dataset using DROP PROCEDURE IF EXISTS.)
- Add unit tests (`bigquery/stored_procedures/bigquery_drop_procedure_test.py`) covering both the success
  path and API error handling (`GoogleAPICallError`)
@iennae
iennae force-pushed the feat/bq-drop-procedure branch from 993886a to d67de8e Compare November 3, 2026 23:32
@iennae
iennae merged commit 45256ad into main Nov 4, 2026
14 of 22 checks passed
@iennae
iennae deleted the feat/bq-drop-procedure branch November 4, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the BigQuery API. samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants