calogica/dbt-date

problem with macro definition

smridhi-sood opened this issue · 3 comments

The following macros throw runtime errors when a query is run:

  1. {{ 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

  1. Similar error for {{ dbt_date.last_month_name() }}

Good catch, thanks!

Fixed in 0.7.1, should be on dbt-hub by EOD. Also included fixes to similar problem in next_month_*. Thanks again!

thank you for resolving it quickly