-
Notifications
You must be signed in to change notification settings - Fork 66
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
Issue 16 in BQ date should be compared to date #17
Conversation
Issue 16 in BQ date should be compared to date
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @VasiliiSurov, helps a lot! I made a couple of comments where we need to add some params but then I think this might be good to go!
macros/get_base_dates.sql
Outdated
@@ -1,4 +1,8 @@ | |||
{% macro get_base_dates(start_date=None, end_date=None, n_dateparts=None, datepart=None) %} | |||
{{ adapter.dispatch('get_base_dates', packages = dbt_date._get_utils_namespaces()) (start_date, end_date) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @VasiliiSurov, love the adapter macro version here, but I think you need to also pass the additional parameters like n_dateparts
and datepart
to the call to dispatch
and also the subsequent macros it's calling, right?
macros/get_base_dates.sql
Outdated
{{ adapter.dispatch('get_base_dates', packages = dbt_date._get_utils_namespaces()) (start_date, end_date) }} | ||
{% endmacro %} | ||
|
||
{% macro default__get_base_dates(start_date, end_date) %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you also need n_dateparts, datepart
here
macros/get_base_dates.sql
Outdated
{% endmacro %} | ||
|
||
{% macro bigquery__get_base_dates(start_date, end_date) %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you also need n_dateparts, datepart
here
Issue 16 in BQ date should be compared to date
@clausherther |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor change and then I think we're good to go!
macros/get_base_dates.sql
Outdated
{{ adapter.dispatch('get_base_dates', packages = dbt_date._get_utils_namespaces()) (start_date, end_date, n_dateparts, datepart) }} | ||
{% endmacro %} | ||
|
||
{% macro default__get_base_dates(start_date=None, end_date=None, n_dateparts=None, datepart=None) %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding those params!
Sorry, one more nitpick: the default__get_base_dates
and bigquery__get_base_dates
macros don't need the None
default parameter values since this get passed in from the dispatch. I'd like to leave those out so we can change the default parameters at the entry point macro without having to change them everywhere else. Thanks!
Issue 16 in BQ date should be compared to date
@clausherther |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks! 👍
Adding BigQuery specific macros get_base_dates