Skip to content

Commit

Permalink
Fabric adapter doesnt work with default cents_to_dollars macro (#43)
Browse files Browse the repository at this point in the history
Using dbt-fabric adapter, trying to run dbt build fails with the
following error:

('42000', "[42000] [Microsoft][ODBC Driver 18 for SQL Server][SQL
Server]Incorrect syntax near '::'. (102) (SQLMoreResults)")

Adding a fabric specific macro (code supplied in this PR) for the
cents_to_dollars macro fixes this.
  • Loading branch information
gwenwindflower authored Jul 4, 2024
2 parents 5ac09d5 + 68815b8 commit 323cd5d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions macros/cents_to_dollars.sql
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@
{% macro bigquery__cents_to_dollars(column_name) %}
round(cast(({{ column_name }} / 100) as numeric), 2)
{% endmacro %}

{% macro fabric__cents_to_dollars(column_name) %}
cast({{ column_name }} / 100 as numeric(16,2))
{% endmacro %}

0 comments on commit 323cd5d

Please sign in to comment.