Adds optional step
param to expect_column_values_to_be_{in,de}creasing
#316
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If set, the test will check that the values are not only strictly increasing/decreasing, but the difference between subsequent values is exactly
step
.Issue this PR Addresses/Closes
Closes #315
Summary of Changes
Adds optional field
step
to testsexpect_column_values_to_be_{in,de}creasing
. If this value is set, it requires that the difference between subsequent values is exactlystep
. If it's not set, the behaviour of the test is the same as now (i.e., this isn't a breaking change).The caveat is that it will only work for numeric columns. The test is literally
value_field - value_field_lag = step
.I wrote this test for my own project. As I've written it already, I decided to sent this PR even without discussions. I'm able to do any changes required to get it merged. It's also OK if you don't think this is a good improvement to the project.
Why Do We Need These Changes
I have a column that must be strictly increasing, but the values need to have a difference of exactly 1 between them. So values like 1, 2, 3 are valid, but 1, 3, 4 are not.
Reviewers
@clausherther