Skip to content

Commit 8e65b27

Browse files
Fix(databricks): Bugfix for get correct datatypes from information_schema table (#5816)
Signed-off-by: Bjarke Enkelund <47357343+MisterWheatley@users.noreply.github.com>
1 parent 9d2ecea commit 8e65b27

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

sqlmesh/core/engine_adapter/databricks.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ def columns(
431431
.order_by("ordinal_position ASC")
432432
)
433433

434-
result = self.cursor.fetchall(query)
434+
self.cursor.execute(query)
435+
result = self.cursor.fetchall()
435436

436437
return {row[0]: exp.DataType.build(row[1], dialect=self.dialect) for row in result}

tests/core/engine_adapter/test_databricks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ def test_columns(mocker: MockFixture, make_mocked_engine_adapter: t.Callable):
578578
),
579579
}
580580

581-
adapter.cursor.fetchall.assert_called_once_with(
581+
adapter.cursor.execute.assert_called_once_with(
582582
parse_one(
583583
"""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""",
584584
dialect="databricks",

0 commit comments

Comments
 (0)