Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion sqlmesh/core/engine_adapter/databricks.py
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ def columns(
.order_by("ordinal_position ASC")
)

result = self.cursor.fetchall(query)
self.cursor.execute(query)
result = self.cursor.fetchall()

return {row[0]: exp.DataType.build(row[1], dialect=self.dialect) for row in result}
2 changes: 1 addition & 1 deletion tests/core/engine_adapter/test_databricks.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ def test_columns(mocker: MockFixture, make_mocked_engine_adapter: t.Callable):
),
}

adapter.cursor.fetchall.assert_called_once_with(
adapter.cursor.execute.assert_called_once_with(
parse_one(
"""SELECT columns.column_name, columns.full_data_type FROM system.information_schema.columns WHERE table_name = 'test_table' AND table_schema = 'test_db' AND table_catalog = 'test_catalog' ORDER BY ordinal_position ASC""",
dialect="databricks",
Expand Down
Loading