-
Notifications
You must be signed in to change notification settings - Fork 491
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
Add a test for sequential values on a column #306
Comments
Hey there @yu-iskw! This is a cool test, I would definitely support it in dbt-utils. I'm doing a big cleanup of open PRs this week, do you mind holding off on writing the code on this for a week or so? |
@clrcrl Good to know. Sure things! |
@clrcrl Please let me know if we are ready to start implementation. |
I will work on it shortly. |
This was already implemented. But, I think it would be great to support the |
@clrcrl Can we close the issue, although we can support |
Additional PR |
Describe the feature
For instance, we incrementally update a table everyday, we want to make sure if missing dates exist or not.
We can implement a test to make sure if distinct values of a column is sequence without missing ones.
When the
updated_date
column should have sequential dates without missing ones from2020-01-01
to2020-12-31
, we can declare the test as below:period
: (Required) duration of sequential values, say about 1 daygaps
: (Optional) gaps of the sequence, default: 1where
: (Optional) conditions to accept missing valuesThe genrated query for the test in BigQuery can be like:
Describe alternatives you've considered
We can of course implement a dbt data test by hand. But, such a test is repeated in different tables.
Additional context
I don't think it is database-specific.
Are you interested in contributing this feature?
I want to implement the feature.
The text was updated successfully, but these errors were encountered: