1fanwang opened a new pull request, #70341:
URL: https://github.com/apache/airflow/pull/70341

   `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
   
   <details><summary>Testing Done</summary>
   
   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.
   
   </details>
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: GitHub Copilot CLI following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to