Skip to content

feat(genai/tuning): Add sample for canceling tuning jobs - #14483

Draft
Kef131 wants to merge 2 commits into
mainfrom
feat(genai/tuning)_add_cancel_tunning_job
Draft

feat(genai/tuning): Add sample for canceling tuning jobs#14483
Kef131 wants to merge 2 commits into
mainfrom
feat(genai/tuning)_add_cancel_tunning_job

Conversation

@Kef131

@Kef131 Kef131 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes b/542305811

Changes:

  • Created genai/tuning/tuning_job_cancel.py using client.tunings.cancel() with region tag googlegenaisdk_tuning_job_cancel.
  • Added unit test test_tuning_job_cancel in genai/tuning/test_tuning_examples.py.
  • Safeguarded the output_gcs_uri test fixture teardown against permission errors during local test runs.

Passed tests
image

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

@Kef131
Kef131 requested review from a team as code owners August 6, 2026 23:37
@snippet-bot

snippet-bot Bot commented Aug 6, 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 Aug 6, 2026
@Kef131
Kef131 marked this pull request as draft August 6, 2026 23:37
@Kef131 Kef131 changed the title feat(genai/tuning): Add sampel for canceling tuning jobs feat(genai/tuning): Add sample for canceling tuning jobs Aug 6, 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 script tuning_job_cancel.py to cancel GenAI tuning jobs, along with corresponding unit tests in test_tuning_examples.py. Feedback on the changes suggests avoiding catching a broad Exception during GCS cleanup in the test setup, recommending catching google.api_core.exceptions.GoogleAPIError instead to prevent masking unrelated errors.

Comment thread genai/tuning/test_tuning_examples.py
@Kef131
Kef131 requested a review from XrossFox August 6, 2026 23:47
@Kef131 Kef131 self-assigned this Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

samples Issues that are directly related to samples.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant