From cf9bb99c2d1115260939ef54715befbe7a4dac7f Mon Sep 17 00:00:00 2001 From: Ishankoradia Date: Thu, 9 May 2024 11:46:23 +0530 Subject: [PATCH] parse None as sql null --- dbt_automation/utils/columnutils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dbt_automation/utils/columnutils.py b/dbt_automation/utils/columnutils.py index 8dd86f3..9d391de 100644 --- a/dbt_automation/utils/columnutils.py +++ b/dbt_automation/utils/columnutils.py @@ -61,6 +61,9 @@ def quote_columnname(colname: str, warehouse: str): def quote_constvalue(value: str, warehouse: str): """encloses a constant string value inside proper quotes""" + if value is None or value.strip().lower() == "none": + return "'" + "NULL" + "'" + if warehouse == "postgres": return "'" + value + "'" elif warehouse == "bigquery":