diff --git a/dbt_automation/utils/bigquery.py b/dbt_automation/utils/bigquery.py index 5bb30e8..336302b 100644 --- a/dbt_automation/utils/bigquery.py +++ b/dbt_automation/utils/bigquery.py @@ -77,7 +77,7 @@ def get_table_data( # order if order_by: query += f""" - ORDER BY {quote_columnname(order_by)} {"ASC" if order == 1 else "DESC"} + ORDER BY {quote_columnname(order_by, "bigquery")} {"ASC" if order == 1 else "DESC"} """ # offset, limit diff --git a/dbt_automation/utils/postgres.py b/dbt_automation/utils/postgres.py index 3124370..5366a65 100644 --- a/dbt_automation/utils/postgres.py +++ b/dbt_automation/utils/postgres.py @@ -107,7 +107,7 @@ def get_table_data( # order if order_by: query += f""" - ORDER BY {quote_columnname(order_by)} {"ASC" if order == 1 else "DESC"} + ORDER BY {quote_columnname(order_by, "postgres")} {"ASC" if order == 1 else "DESC"} """ # offset, limit