From 64f231eff23ac14cba9225bd5d755763d73f3d51 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Fri, 1 Dec 2023 16:50:14 +0000 Subject: [PATCH] fix macros --- dbt/include/firebolt/macros/utils/cast_bool_to_text.sql | 4 ++-- dbt/include/firebolt/macros/utils/datediff.sql | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dbt/include/firebolt/macros/utils/cast_bool_to_text.sql b/dbt/include/firebolt/macros/utils/cast_bool_to_text.sql index 296ddf1de..28b02f31d 100644 --- a/dbt/include/firebolt/macros/utils/cast_bool_to_text.sql +++ b/dbt/include/firebolt/macros/utils/cast_bool_to_text.sql @@ -1,7 +1,7 @@ {% macro firebolt__cast_bool_to_text(field) %} CASE - WHEN {{ field }} = 0 THEN 'false' - WHEN {{ field }} = 1 THEN 'true' + WHEN {{ field }} = false THEN 'false' + WHEN {{ field }} = true THEN 'true' ELSE NULL END {% endmacro %} diff --git a/dbt/include/firebolt/macros/utils/datediff.sql b/dbt/include/firebolt/macros/utils/datediff.sql index 76f24ed03..c466ddf8c 100644 --- a/dbt/include/firebolt/macros/utils/datediff.sql +++ b/dbt/include/firebolt/macros/utils/datediff.sql @@ -1,6 +1,6 @@ {% macro firebolt__datediff(first_date, second_date, datepart) -%} - datediff( + date_diff( '{{ datepart }}', {{ first_date }} :: TIMESTAMP, {{ second_date }} :: TIMESTAMP