Skip to content

Commit effeba3

Browse files
authored
Fix: Columns should be sourced from the target table and not the temporary merge table (#4191)
1 parent 6559a00 commit effeba3

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

sqlmesh/core/engine_adapter/bigquery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ def insert_overwrite_by_partition(
611611
if columns_to_types is None or columns_to_types[
612612
partition_column.name
613613
] == exp.DataType.build("unknown"):
614-
columns_to_types = self.columns(temp_table_name)
614+
columns_to_types = self.columns(table_name)
615615

616616
partition_type_sql = columns_to_types[partition_column.name].sql(dialect=self.dialect)
617617

tests/core/engine_adapter/test_bigquery.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ def test_insert_overwrite_by_partition_query_unknown_column_types(
116116
},
117117
)
118118

119-
columns_mock.assert_called_once_with(
120-
exp.to_table(f"test_schema.__temp_test_table_{temp_table_id}")
121-
)
119+
columns_mock.assert_called_once_with(table_name)
122120

123121
sql_calls = _to_sql_calls(execute_mock)
124122
assert sql_calls == [

0 commit comments

Comments
 (0)