-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Update test_variant_get_error_when_cast_failure... tests to uses a valid VariantArray
#8921
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
Conversation
VariantArray
VariantArraytest_variant_get_error_when_cast_failure... tests to uses a valid VariantArray
| let mut builder = VariantArrayBuilder::new(3); | ||
| // 86401000000 is invalid for Time64Microsecond (max is 86400000000) | ||
| Time64MicrosecondArray::from(vec![ | ||
| Some(86401000000), |
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.
This is an invalid Time64MicrosecondArray and thus I would expect this array to be impossible to create with shred_variant (I would expect shred_variant to error)
| err.to_string().contains( | ||
| "Cast error: Cast failed at index 0 (array type: Time64(µs)): Invalid microsecond from midnight: 86401000000" | ||
| ) | ||
| "Cast error: Failed to extract primitive of type Time64(µs) from variant Int64(86401000000) at path VariantPath([])" |
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 case still errors, but the message is different
XiangpengHao
left a comment
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.
|
FYI @scovich @friendlymatthew , @klion26 and @codephage2020 |
friendlymatthew
left a comment
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.
Makes sense to me
klion26
left a comment
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 for the improvement, LGTM
|
Thanks @klion26 and @XiangpengHao |
Which issue does this PR close?
variant_getperformance on a perfect shredding #8887Rationale for this change
In this comment here: #8887 (comment)
One of the tests intended to cover the behavior of CastOptions actually contains an invalid Shredded variant (the values could not have been shredded successfully because the integer values are out of range)
My understanding is that the test is intended to illustrate that casting fails when a non-shredded variant into a shredded variant. Thus, it would not have been possible to create the incorrect shredded variant in the first place (there would have been an error during shredding)
What changes are included in this PR?
Are these changes tested?
Only tests
Are there any user-facing changes?
None -- this is a test only change