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

   `yaml_conf` and `yaml_conf_file` are template fields, so they are rendered 
after `__init__` runs. The base constructor raised `AirflowException` when 
neither was set — a check against the un-rendered values. Move it into a 
`_validate_yaml_conf()` helper called from `execute()` in both the create and 
delete operators, so the presence check runs after rendering.
   
   related: #70296
   
   <details><summary>Testing Done</summary>
   
   New `test_missing_yaml_conf_rejected_at_execute` constructs both operators 
with neither field and asserts the `AirflowException` now surfaces from 
`execute()`. It fails on the pre-fix source (the constructor raises first) and 
passes after. `test_resource.py`: 12 passed. `validate_operators_init.py` on 
the module 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