Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem with macro definition #94

Closed
smridhi-sood opened this issue Dec 20, 2022 · 3 comments · Fixed by #95
Closed

problem with macro definition #94

smridhi-sood opened this issue Dec 20, 2022 · 3 comments · Fixed by #95

Comments

@smridhi-sood
Copy link

smridhi-sood commented Dec 20, 2022

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() }}
@clausherther
Copy link
Contributor

Good catch, thanks!

@clausherther
Copy link
Contributor

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
Copy link
Author

thank you for resolving it quickly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants