-
Notifications
You must be signed in to change notification settings - Fork 47
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
start_date and end_date arguments need to be cast as date #20
Comments
Interesting! Not to be all "works on my machine", but this did literally work on my machine 😂 your way is better though! dates are fiddly and it's better to be explicit. I'd happily merge that PR 🥳 |
That's so strange? I wonder if it could be a warehouse specific strangeness? I was trying the arguments using bigquery and was not having any luck. Dates are fiddly indeed haha I'll open up the PR shortly. |
Confirming this issue on Redshift via the error message:
#22 solves it. Looking forward to the release! |
Thanks for confirming @dannyshaw! I'll be doing a release shortly 🎉 |
Description of the Issue
When leveraging the
start_date
andend_date
arguments for a metric I receive an error indicating the datatypes forperiod
andupper/lower_bound
fields within thefinal
cte "where" condition do not match. I believe this issue is originating from within the get_metric_sql.sql macro.How to reproduce
Create the following
metric_test.sql
file:Execute
dbt run -s metric_test
and see the below error:Proposed Solution
Digging further into this, I think the solution is pretty straight forward. I believe the issue can be addressed by casting the
start_date
andend_date
references in the below line as dates:dbt_metrics/macros/get_metric_sql.sql
Lines 146 to 147 in 861b095
I actually have a working branch on my forked repo that I am using to get around this error. See the quick changes here.
I am happy to open a PR if this is an issue others are encountering. Additionally, please let me know if I am missing something. Thanks!
The text was updated successfully, but these errors were encountered: