Support Databricks query tags in session properties
Description
The Databricks SQL connector supports per-statement query_tags, but SQLMesh did not previously pass model/session-level session_properties.query_tags through to the connector. This change stores validated query tags for the active adapter session and forwards them to Databricks SQL connector executions.
Query tags are only applied on the Databricks SQL connector path. They are not passed when execution is routed through Spark session / Databricks Connect paths, since those cursors do not support the query_tags argument.
ISSUE: https://github.com/SQLMesh/sqlmesh/issues/5795
Test Plan
- Added Databricks engine adapter tests covering:
- forwarding session query tags to Databricks SQL connector executions
- clearing query tags after the session ends
- preserving explicit per-statement
query_tags - accepting
NULLquery tag values - rejecting invalid
session_properties.query_tags - not applying query tags to Spark session / Databricks Connect execution paths
- Verified the installed Databricks SQL connector exposes
Cursor.execute(..., query_tags=...). - Built the package wheel successfully.
- Ran:
pytest -q -o addopts='' tests/core/engine_adapter/test_databricks.py
python -m pip wheel . --no-deps -w /tmp/sqlmesh-wheel-final
Will fix the failing style tests.
@izeigerman Perhaps you can have a look at this 😄 ?