Emit GCSToGCSOperator deprecation warnings after rendering - #70449
Conversation
2930317 to
67dcc24
Compare
potiuk
left a comment
There was a problem hiding this comment.
Thanks — correct fix, and the best-tested version of this pattern I've seen in the current batch. source_object, source_objects and delimiter are all template fields, so emitting these deprecation warnings from __init__ checked the raw "{{ ... }}" strings: a templated wildcard never warned, and a literal one warned at parse time for every Dag processor loop rather than once per task run.
test_wildcard_deprecation_warning_uses_rendered_source_object is the part that matters — it builds a real DAG and asserts the warning fires on the rendered value. That's the actual contract, and it's what distinguishes this from a mechanical move.
Pulling the three warnings into _warn_on_deprecated_template_fields() rather than inlining them in execute also keeps execute readable.
Note there's a near-identical PR in #70621, opened three days after this one. I've suggested there that it be closed in favour of this one — this came first and has the stronger test. No action needed from you.
Two small things inline.
Drafted-by: Claude Code (Opus 5); reviewed by @potiuk before posting
67dcc24 to
ab227d3
Compare
|
@potiuk Made requested changes |
source_object,source_objects, anddelimiteronGCSToGCSOperatorare template fields, so Jinja renders them after__init__runs. The wildcard/delimiter deprecation warnings were emitted in__init__, so they checked the raw{{ ... }}expressions instead of the rendered values. This moves them into a helper that runs at the start ofexecute().Part of #70296.