File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
tests/core/engine_adapter/integration Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -303,10 +303,10 @@ workflows:
303303 - bigquery
304304 - clickhouse-cloud
305305 - athena
306- # filters:
307- # branches:
308- # only:
309- # - main
306+ filters :
307+ branches :
308+ only :
309+ - main
310310 - ui_style
311311 - ui_test
312312 - vscode_test
Original file line number Diff line number Diff line change @@ -1947,6 +1947,7 @@ def test_incremental_by_unique_key_model_when_matched(ctx: TestContext):
19471947 kind INCREMENTAL_BY_UNIQUE_KEY (
19481948 unique_key item_id,
19491949 batch_size 1,
1950+ merge_filter source.event_date > target.event_date,
19501951 when_matched WHEN MATCHED THEN UPDATE SET target.value = source.value, target.event_date = source.event_date
19511952 ),
19521953 { table_format }
@@ -1968,8 +1969,17 @@ def test_incremental_by_unique_key_model_when_matched(ctx: TestContext):
19681969
19691970 test_model = context .get_model (f"{ schema } .test_model_when_matched" )
19701971
1971- # Verify that the model has the when_matched clause configured
1972+ # Verify that the model has the when_matched clause and merge_filter
19721973 assert test_model .kind .when_matched is not None
1974+ assert (
1975+ test_model .kind .when_matched .sql ()
1976+ == '(WHEN MATCHED THEN UPDATE SET "__MERGE_TARGET__"."value" = "__MERGE_SOURCE__"."value", "__MERGE_TARGET__"."event_date" = "__MERGE_SOURCE__"."event_date")'
1977+ )
1978+ assert test_model .merge_filter is not None
1979+ assert (
1980+ test_model .merge_filter .sql ()
1981+ == '"__MERGE_SOURCE__"."event_date" > "__MERGE_TARGET__"."event_date"'
1982+ )
19731983
19741984 actual_df = (
19751985 ctx .get_current_data (test_model .fqn ).sort_values (by = "item_id" ).reset_index (drop = True )
You can’t perform that action at this time.
0 commit comments