Skip to content

Google Cloud Run: replace AirflowException with Python built-in exceptions#67769

Closed
shahar1 wants to merge 1 commit into
apache:mainfrom
shahar1:cleanup/cloud-run-airflow-exceptions
Closed

Google Cloud Run: replace AirflowException with Python built-in exceptions#67769
shahar1 wants to merge 1 commit into
apache:mainfrom
shahar1:cleanup/cloud-run-airflow-exceptions

Conversation

@shahar1
Copy link
Copy Markdown
Contributor

@shahar1 shahar1 commented May 30, 2026

Summary

AirflowException is pending deprecation. Replace all usages in providers/google/cloud/operators/cloud_run.py with the appropriate Python built-in exception types:

  • TimeoutError for operation timeouts in execute_complete
  • RuntimeError for all other error conditions throughout the file

Update test assertions to match and remove the file entry from scripts/ci/prek/known_airflow_exceptions.txt since no AirflowException usages remain.

This is a pure exception-type cleanup with no behaviour change. Spun out of #67767 to keep concerns separate.


Was generative AI tooling used to co-author this PR?
  • Yes — Claude Code (claude-sonnet-4-6)

Generated-by: Claude Code (claude-sonnet-4-6) following the guidelines

…tions

AirflowException is pending deprecation. Replace all usages in
providers/google/cloud/operators/cloud_run.py with the appropriate
Python built-in exception types:

- TimeoutError for operation timeouts
- RuntimeError for all other error conditions

Update the corresponding test assertions and remove the file from
scripts/ci/prek/known_airflow_exceptions.txt since no AirflowException
usages remain.
@boring-cyborg boring-cyborg Bot added area:dev-tools area:providers backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch provider:google Google (including GCP) related issues labels May 30, 2026
@shahar1 shahar1 marked this pull request as ready for review May 30, 2026 06:39
Copy link
Copy Markdown
Contributor

@amoghrajesh amoghrajesh left a comment

Choose a reason for hiding this comment

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

This will be a breaking change for users upgrading to this version of google provider and whoever relied on the AirflowException raised for any custom behaviour will now break.

I don't know if we agreed regarding this on devlist but this should be a CHANGELOG entry as a "Breaking Change" as I see it (if we havent discussed on devlist, nows the time).

Requesting changes to avoid accidental merge

missing_fields = [k for k in ["project_id", "region", "service_name"] if not getattr(self, k)]
if not self.project_id or not self.region or not self.service_name:
raise AirflowException(
raise RuntimeError(
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.

More of a ValueError?

missing_fields = [k for k in ["project_id", "region", "service_name"] if not getattr(self, k)]
if not self.project_id or not self.region or not self.service_name:
raise AirflowException(
raise RuntimeError(
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.

Same here?

@shahar1
Copy link
Copy Markdown
Contributor Author

shahar1 commented May 30, 2026

This will be a breaking change for users upgrading to this version of google provider and whoever relied on the AirflowException raised for any custom behaviour will now break.

I don't know if we agreed regarding this on devlist but this should be a CHANGELOG entry as a "Breaking Change" as I see it (if we havent discussed on devlist, nows the time).

Requesting changes to avoid accidental merge

You've got a valid point - I assume that your main concerns are on_failure_callback / on_retry_callback.
I'll close this for now and raise a discussion on devlist - we might want to make such changes for packages entirely, so we won't have to make breaking changes in each release.
Thanks for calling out!

@shahar1 shahar1 closed this May 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:dev-tools area:providers backport-to-v3-2-test Mark PR with this label to backport to v3-2-test branch provider:google Google (including GCP) related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants