You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Databricks runs fail to execute on 0.235.4 with thrift error #5841
When running with SQLMesh 0.235.4 and Databricks SQL Connector, existing environments fail to run in Databricks with the error:
ERROR:databricks.sql.thrift_backend:ThriftBackend.attempt_request: Exception: encoding without a string argument.
Downgrading to 0.235.3 resolves this issue.
Root Cause
The underlying model SQL I can see being executed successfully against a Databricks Warehouse, the failure occurs when acquiring the built tables' column types.
I believe that this has been caused by PRs #5783 and #5816, as when I remove the DatabricksEngineAdapter.columns method added by those PRs to sqlmesh/core/engine_adapter/databricks.py this error does not occur.
Potentially the fix would be to change line 434 from:
Opened PR #5849 to fix this. The issue is that self.cursor.execute(query) passes a sqlglot expression object to the Databricks SQL Connector's thrift cursor, which expects a string. Fixed by using query.sql(dialect=self.dialect) to render the SQL string first.
Opened PR #5849 to fix this. The issue is that self.cursor.execute(query) passes a sqlglot expression object to the Databricks SQL Connector's thrift cursor, which expects a string. Fixed by using query.sql(dialect=self.dialect) to render the SQL string first.
Thanks @cschanhniem - I came to the same conclusion and had opened PR #5848 as well.
Activity
cschanhniem commentedon Jun 19, 2026
Opened PR #5849 to fix this. The issue is that
self.cursor.execute(query)passes a sqlglot expression object to the Databricks SQL Connector's thrift cursor, which expects a string. Fixed by usingquery.sql(dialect=self.dialect)to render the SQL string first.davem-bis commentedon Jun 19, 2026
Thanks @cschanhniem - I came to the same conclusion and had opened PR #5848 as well.