-
-
Notifications
You must be signed in to change notification settings - Fork 139
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
expect_row_values_to_have_recent_data fails in BigQuery for TIMESTAMP columns #104
Comments
Thanks for this issue @kdw2126 ! This timestamp/date issue has been a problem for a while, I think even |
Closed via #145 |
It didn't fix the issue.
|
@nirakon 😩 it passed tests on BQ, but I'll reopen this and look into it. I think this more of an issue with dbt_date.now() returning a datetime. |
I think it's the So the inner CTE ("max_recency") casts it as timestamp, but the outer CTE ("dbt_internal_test") casts it as datetime. I'm using the version 0.5.2 with a date and had a different issue: if the column in my dbt model is a DATE, it returns the following error: I think I'll rollback to version 0.5.1 while this issue is not closed (or maybe change my column to a TIMESTAMP in case this macro won't be compatible with dates). |
@bascheibler curious, does the |
It works! Thank you for the hint, @clausherther. |
@bascheibler good to hear! One gotcha with |
@AdeelK93 tagging you here in the issue instead of the closed PR. Can you describe your error a bit more including the error message and the data type of |
One option is to make the test more configurable to either let users specify a data type (date or timestamp etc) and/or whether or not to check for future dates at all. |
Sure, my source data has a date column named date, which worked fine in the old version of the test. In the new version, I must cast the date as a timestamp to get the upper part of the query to work, but then as soon as I do that, the lower part of the query fails as a timestamp is being compared to a datetime. |
@AdeelK93 Blerg. That is super helpful, thanks! Will try to get to the bottom of it this week. Sorry about the hiccup. |
(Looks like this is also an issue...
) |
hi all, I am getting the same error when trying to run The specific error I am getting is: I am currently using dbt_expectations 0.5.6. Let me know if there is more information I need to provide. |
@pan-kadams thanks for pointing this out! Would you mind opening a new issue for |
If you add a expect_row_values_to_have_recent_data argument to a TIMESTAMP column, you will get a failure driven by two characteristics of the existing implementation:
Given that a master time zone is specified in vars under dbt_project.yml, it seems possible to rewrite these comparisons using the appropriate recasting statements to allow columns of a TIMESTAMP type to be compatible with the expect_row_values_to_have_recent_data test.
The text was updated successfully, but these errors were encountered: