Check GCSToGCSOperator deprecation warnings after template rendering - #70621
Open
bramhanandlingala wants to merge 1 commit into
Open
Check GCSToGCSOperator deprecation warnings after template rendering#70621bramhanandlingala wants to merge 1 commit into
bramhanandlingala wants to merge 1 commit into
Conversation
bramhanandlingala
requested review from
amoghrajesh,
ashb,
bugraoz93,
gopidesupavan,
jason810496,
jscheffl,
potiuk and
shahar1
as code owners
July 28, 2026 12:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the google provider's GCSToGCSOperator entry from the #70296 exemption-list burn-down.
source_object,source_objects, anddelimiterare template fields, but__init__inspected their content (checking for a wildcard character, or truthiness ofdelimiter) to decide whether to emit a deprecation warning — so these checks ran on the un-rendered Jinja expression instead of the actual rendered value.Moved all three deprecation-warning checks from
__init__intoexecute(), right before the fields are used.__init__now only does plain assignments.warnings.warn(...)blocks from__init__.execute(), now readingself.source_object/self.source_objects/self.delimiter(rendered values) instead of the constructor arguments.test_get_openlineage_facets_on_complete,test_execute_returns_list_of_destination_uris_multiple_files) to expect the warning on.execute()instead of construction.pytestmark = pytest.mark.filterwarnings("ignore::airflow.exceptions.AirflowProviderDeprecationWarning")at module level in the test file, since this repo'sforbidden_warningspytest config turns this warning into a hard error by default, and ~15 other existing tests exercise wildcard/delimiter inputs incidentally without testing the deprecation itself. This mirrors the existing pattern used intest_bigquery.pyandtest_kubernetes_engine.pyfor the same warning class.validate_operators_init_exemptions.txt.Verified locally that
scripts/ci/prek/validate_operators_init.pyreports zero findings for this class after the change, and that the full existing test suite intest_gcs_to_gcs.pypasses.Related to #70296
Gen-AI disclosure: I used a generative AI tool to help identify the root
cause, write tests, and draft the PR description. I reviewed, tested, and
verified all changes locally before submitting.
Was generative AI tooling used to co-author this PR?
Generated-by: Claude following the guidelines