problem with macro definition
smridhi-sood opened this issue · 3 comments
smridhi-sood commented
The following macros throw runtime errors when a query is run:
- {{ dbt_date.last_month_number() }}
Definition:
{%- macro last_month_number(tz=None) -%}
{{ dbt_date.date_part('month', dbt_date.last_month(1, tz)) }}
{%- endmacro -%}
Error:
macro 'dbt_macro__last_month' takes not more than 1 argument(s) > in macro last_month_number (macros/calendar_date/last_month_number.sql) > called by macro last_month (macros/calendar_date/last_month.sql)
Solution:
Remove the arguments for dbt_date.last_month() in the macro definition
- Similar error for {{ dbt_date.last_month_name() }}
clausherther commented
Good catch, thanks!
clausherther commented
Fixed in 0.7.1
, should be on dbt-hub by EOD. Also included fixes to similar problem in next_month_*
. Thanks again!
smridhi-sood commented
thank you for resolving it quickly