AlejandroMorgante opened a new pull request, #76709:
URL: https://github.com/apache/airflow/pull/76709

   Allow Jinja expressions in `DatabricksSQLStatementsOperator.statement` and 
`parameters` to render before the SQL request is submitted. This lets Dag 
authors pass execution dates and Dag params through bound SQL parameters 
instead of sending literal `{{ ... }}` strings to Databricks.
   
   Adds a regression test, a documented example, and a system test that checks 
rendered values in a real SQL warehouse and stops the warehouse during cleanup.
   
   Validation:
   
   - Breeze operator tests: 23 passed.
   - Regression check: the new test fails when the two template fields are 
removed and passes when restored.
   - Real Databricks serverless system test: passed; verified the warehouse was 
stopped afterward with its configuration unchanged. The query creates no tables.
   - Ruff, pre-commit static checks, manual checks, and targeted provider mypy 
passed. The broader related-provider matrix and documentation builds are left 
to CI.
   
   Unit tests:
   
   ```sh
   breeze run --python 3.11 --skip-image-upgrade-check pytest 
providers/databricks/tests/unit/databricks/operators/test_databricks.py::TestDatabricksSQLStatementsOperator
 -xvs
   ```
   
   System test, with a local initialization script configuring 
`databricks_default` and exporting `WAREHOUSE_ID`:
   
   ```sh
   SYSTEM_TESTS_ENV_ID=sqlstatementtemplatesfinal \
   BREEZE_INIT_COMMAND='source 
/opt/airflow/dev/.build/sql_statement_templating_system_init.sh' \
   breeze testing system-tests --python 3.11 --forward-credentials \
     --mount-sources all --keep-env-variables --test-timeout 1200 -- \
     
providers/databricks/tests/system/databricks/example_databricks_sql_statement_parameters.py
 -v -s
   ```
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Codex (GPT-6)
   
   Generated-by: Codex (GPT-6) 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