-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Minor: Improve arrow_statistics
tests
#10927
Conversation
@@ -164,6 +164,36 @@ impl TestReader { | |||
} | |||
} | |||
|
|||
/// Which statistics should we check? |
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 this is easier to understand (and now it is at least documented why sometimes the page stats are the same and some they are different)
assert_eq!( | ||
&row_counts, &expected_row_counts, | ||
"{column_name}: Mismatch with expected row counts. \ | ||
Actual: {row_counts:?}. Expected: {expected_row_counts:?}" | ||
); | ||
} else { | ||
} |
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.
The code can now check either or both types of statistics
// row counts are [5, 5, 5, 5] | ||
expected_row_counts: UInt64Array::from(vec![5, 5, 5, 5]), | ||
column_name: "i64", | ||
check: Check::Both, |
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 thought Both
was easier to understand here than the loop -- and will be a better pattern to follow to add supprot for other types
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.
lgtm thanks @alamb
the enum Both probably will require modifications though if there is more Check variants in future
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.
LGTM! Thanks @alamb
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 lgtm
Thanks everyone for the reviews |
Which issue does this PR close?
Part of #10922
Rationale for this change
I thought of a way to make the tests easier to write -- which will be important as we start expanding out the test coverage
What changes are included in this PR?
Add an enum to make more explicit what is being testsed
Are these changes tested?
Only tests
Are there any user-facing changes?
No
cc @marvinlanhenke