Derive DbtCloudGetJobRunArtifactOperator default file name after rendering - #70336
Merged
Conversation
…ering run_id, path and output_file_name are template fields, rendered after __init__ runs. The constructor built the default output_file_name from self.run_id and self.path (the un-rendered Jinja expressions) and flattened slashes then. With a templated path, the '/'->'-' replacement ran on the expression, not the resolved path, so a rendered path like 'a/b/c.json' kept its slashes in the file name. Derive the default in execute(), after rendering. related: apache#70296 Signed-off-by: 1fanwang <1fannnw@gmail.com>
1fanwang
requested review from
amoghrajesh,
ashb,
bugraoz93,
gopidesupavan,
jason810496,
josh-fell,
jscheffl and
potiuk
as code owners
July 23, 2026 21:41
1fanwang
marked this pull request as draft
July 24, 2026 05:47
Condense the after-rendering rationale to a single concise note. Signed-off-by: 1fanwang <1fannnw@gmail.com>
1fanwang
marked this pull request as ready for review
July 24, 2026 06:23
shahar1
approved these changes
Jul 24, 2026
Contributor
Backport failed to create: v3-3-test. View the failure log Run detailsNote: As of Merging PRs targeted for Airflow 3.X In matter of doubt please ask in #release-management Slack channel.
You can attempt to backport this manually by running: cherry_picker 26d3bbb v3-3-testThis should apply the commit to the v3-3-test branch and leave the commit in conflict state marking After you have resolved the conflicts, you can continue the backport process by running: cherry_picker --continueIf you don't have cherry-picker installed, see the installation guide. |
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.
run_id,pathandoutput_file_nameare template fields, so they are rendered after__init__runs. Whenoutput_file_namewas omitted, the constructor built the default fromself.run_idandself.pathand flattened slashes then — on the un-rendered Jinja expressions. With a templatedpath, the'/'→'-'replacement ran on the expression, not the resolved path, so a rendered path likea/b/c.jsonkept its slashes in the file name (Paththen wrote into nested directories). Derive the default inexecute(), after rendering.related: #70296
Testing Done
New
test_default_output_file_name_uses_rendered_pathrenders a templatedpath({{ params.p }}→path/to/my/manifest.json) and asserts the default name is<run_id>_path-to-my-manifest.json. It fails on the pre-fix source (slashes survive, name is<run_id>_path/to/my/manifest.json) and passes after.TestDbtCloudGetJobRunArtifactOperator: 11 passed.validate_operators_init.pyon the operator exits 0.Was generative AI tooling used to co-author this PR?
Generated-by: GitHub Copilot CLI following the guidelines