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

   `files`, `table_name` and `file_location` are template fields, so they are 
rendered after `__init__` runs. The constructor checked `files`/`pattern` 
mutual exclusivity and rejected an empty `table_name`/`file_location` there, 
acting on the un-rendered Jinja expressions — so a templated `table_name` 
couldn't resolve before the empty check ran. Move those three checks into 
`execute()`. The `file_format` check reads no template field and stays in 
`__init__`.
   
   related: #70296
   
   <details><summary>Testing Done</summary>
   
   New `test_files_and_pattern_rejected_at_execute` constructs with both 
`files` and `pattern` and asserts the `AirflowException` now surfaces from 
`execute()`. It fails on the pre-fix source (the constructor raises first) and 
passes after. `test_databricks_sql.py`: 52 passed. `validate_operators_init.py` 
exits 0 and 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