Skip to content

Derive DbtCloudGetJobRunArtifactOperator default file name after rendering - #70336

Merged
shahar1 merged 2 commits into
apache:mainfrom
1fanwang:fix-dbt-artifact-init
Jul 24, 2026
Merged

Derive DbtCloudGetJobRunArtifactOperator default file name after rendering#70336
shahar1 merged 2 commits into
apache:mainfrom
1fanwang:fix-dbt-artifact-init

Conversation

@1fanwang

@1fanwang 1fanwang commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

run_id, path and output_file_name are template fields, so they are rendered after __init__ runs. When output_file_name was omitted, the constructor built the default from self.run_id and self.path and flattened slashes then — on the un-rendered Jinja expressions. 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 (Path then wrote into nested directories). Derive the default in execute(), after rendering.

related: #70296

Testing Done

New test_default_output_file_name_uses_rendered_path renders a templated path ({{ 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.py on the operator exits 0.


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: GitHub Copilot CLI following the guidelines

…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>
Condense the after-rendering rationale to a single concise note.

Signed-off-by: 1fanwang <1fannnw@gmail.com>
@1fanwang
1fanwang marked this pull request as ready for review July 24, 2026 06:23
@shahar1
shahar1 merged commit 26d3bbb into apache:main Jul 24, 2026
131 of 136 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Backport failed to create: v3-3-test. View the failure log Run details

Note: As of Merging PRs targeted for Airflow 3.X
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.

In matter of doubt please ask in #release-management Slack channel.

Status Branch Result
v3-3-test Commit Link

You can attempt to backport this manually by running:

cherry_picker 26d3bbb v3-3-test

This should apply the commit to the v3-3-test branch and leave the commit in conflict state marking
the files that need manual conflict resolution.

After you have resolved the conflicts, you can continue the backport process by running:

cherry_picker --continue

If you don't have cherry-picker installed, see the installation guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants