From 3ec01f509afaaa8aa3cc0d654e0a769c9d4e0d7b Mon Sep 17 00:00:00 2001 From: Sam Debruyn Date: Sun, 17 May 2026 13:24:01 +0200 Subject: [PATCH] Fix expect_column_to_exist rendering Python booleans as SQL literals Use integer literals (1/0) instead of Python True/False, which are not valid SQL on T-SQL dialects (Microsoft Fabric, SQL Server, Azure SQL). Fixes #43 --- macros/schema_tests/table_shape/expect_column_to_exist.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/macros/schema_tests/table_shape/expect_column_to_exist.sql b/macros/schema_tests/table_shape/expect_column_to_exist.sql index 644d04b..8cf60da 100644 --- a/macros/schema_tests/table_shape/expect_column_to_exist.sql +++ b/macros/schema_tests/table_shape/expect_column_to_exist.sql @@ -10,11 +10,11 @@ {%- set column_index_0 = column_index - 1 if column_index > 0 else 0 -%} - {%- set column_index_matches = true if matching_column_index == column_index_0 else false %} + {%- set column_index_matches = 1 if matching_column_index == column_index_0 else 0 %} {%- else -%} - {%- set column_index_matches = true -%} + {%- set column_index_matches = 1 -%} {%- endif %} @@ -29,7 +29,7 @@ select * from test_data where - not(matching_column_index >= 0 and column_index_matches) + not(matching_column_index >= 0 and column_index_matches = 1) {%- endif -%} {%- endtest -%}