You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Fabric adapter should use DELETE/INSERT strategy, not MERGE.
68
-
assertto_sql_calls(adapter) == [
69
-
"""DELETE FROM [test_table] WHERE [b] BETWEEN '2022-01-01' AND '2022-01-02';""",
70
-
"""INSERT INTO [test_table] ([a], [b]) SELECT [a], [b] FROM (SELECT [a], [b] FROM [tbl]) AS [_subquery] WHERE [b] BETWEEN '2022-01-01' AND '2022-01-02';""",
71
-
]
69
+
# Get the list of generated SQL strings
70
+
actual_sql_calls=to_sql_calls(adapter)
71
+
72
+
# There should be two calls: DELETE and INSERT
73
+
assertlen(actual_sql_calls) ==2
74
+
75
+
# Assert the DELETE statement is correct (string comparison is fine for this simple one)
76
+
assert (
77
+
actual_sql_calls[0]
78
+
=="DELETE FROM [test_table] WHERE [b] BETWEEN '2022-01-01' AND '2022-01-02';"
79
+
)
80
+
81
+
# Assert the INSERT statement is semantically correct
82
+
expected_insert_sql="""
83
+
INSERT INTO [test_table] ([a], [b])
84
+
SELECT [a], [b] FROM (SELECT [a], [b] FROM [tbl]) AS [_subquery]
85
+
WHERE [b] BETWEEN '2022-01-01' AND '2022-01-02';
86
+
"""
87
+
88
+
# Use assert_exp_eq to compare the parsed SQL expressions
0 commit comments