We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 27cf031 commit 9e9d48bCopy full SHA for 9e9d48b
sqlmesh/core/engine_adapter/base.py
@@ -1756,7 +1756,17 @@ def remove_managed_columns(
1756
"static",
1757
existing_rows_query.where(valid_to_col.is_(exp.Null()).not_())
1758
if truncate
1759
- else existing_rows_query.where(
+ else exp.select(
1760
+ *(
1761
+ exp.cast(valid_to_col, time_data_type).as_(col)
1762
+ if col == valid_to_col.name
1763
+ else exp.column(col)
1764
+ for col in columns_to_types
1765
+ ),
1766
+ exp.true().as_("_exists"),
1767
+ )
1768
+ .from_(target_table)
1769
+ .where(
1770
exp.and_(
1771
valid_from_col <= cleanup_ts,
1772
0 commit comments