Skip to content

Validate Databricks Repos operators' template fields after rendering#70341

Merged
shahar1 merged 4 commits into
apache:mainfrom
1fanwang:fix-databricks-repos-init
Jul 24, 2026
Merged

Validate Databricks Repos operators' template fields after rendering#70341
shahar1 merged 4 commits into
apache:mainfrom
1fanwang:fix-databricks-repos-init

Conversation

@1fanwang

Copy link
Copy Markdown
Contributor

branch, tag and repo_path are template fields, so they are rendered after __init__ runs. The Create, Update and Delete Repos operators enforced their mutual-exclusivity and presence combinations in the constructor, acting on the un-rendered Jinja expressions — so a templated branch/tag/repo_path couldn't resolve before the check ran. Move those checks into execute(), preserving order. The git_url/git_provider detection reads no template field and stays in __init__.

related: #70296

Testing Done

Updated each operator's test_init_exception to construct first, then assert the AirflowException surfaces from execute() (covering all combinations: branch+tag, neither; repo_id+repo_path, neither). All three fail on the pre-fix source (the constructor raises first) and pass after. test_databricks_repos.py: 11 passed. validate_operators_init.py exits 0; the raise AirflowException count is unchanged.


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

Generated-by: GitHub Copilot CLI following the guidelines

branch, tag and repo_path are template fields, rendered after __init__ runs. The
Create, Update and Delete Repos operators enforced their mutual-exclusivity and
presence combinations in the constructor, acting on the un-rendered Jinja
expressions. Move those checks into execute(), preserving order; git_url/git_provider
detection reads no template field and stays in __init__.

related: apache#70296
Signed-off-by: 1fanwang <1fannnw@gmail.com>

@shahar1 shahar1 left a comment

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.

Could you please resolve conflicts?

1fanwang and others added 3 commits July 24, 2026 11:31
…s-init

Signed-off-by: 1fanwang <1fannnw@gmail.com>

# Conflicts:
#	scripts/ci/prek/validate_operators_init_exemptions.txt
Signed-off-by: 1fanwang <1fannnw@gmail.com>
@shahar1
shahar1 merged commit 82a2c91 into apache:main Jul 24, 2026
34 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 82a2c91 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