Skip to content

Commit e6c4688

Browse files
authored
fix: in scd type 2 also make sure all columns are known (#2349)
1 parent a6542f9 commit e6c4688

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sqlmesh/core/engine_adapter/base.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,11 @@ def _scd_type_2(
12731273
source_table, columns_to_types, target_table=target_table, batch_size=0
12741274
)
12751275
columns_to_types = columns_to_types or self.columns(target_table)
1276-
if valid_from_name not in columns_to_types or valid_to_name not in columns_to_types:
1276+
if (
1277+
valid_from_name not in columns_to_types
1278+
or valid_to_name not in columns_to_types
1279+
or not columns_to_types_all_known(columns_to_types)
1280+
):
12771281
columns_to_types = self.columns(target_table)
12781282
if not columns_to_types:
12791283
raise SQLMeshError(f"Could not get columns_to_types. Does {target_table} exist?")

0 commit comments

Comments
 (0)