-
Notifications
You must be signed in to change notification settings - Fork 180
chore: all scalars support cast #1965
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
Merged
Merged
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
cf784ba
chore: all scalars support cast
danking 7bc264c
we indeed may cast to an extension type
danking f0a0e99
the min/max of an array without valid values is not defined (and defi…
danking 91c4b36
unused variable
danking 105c894
clippy
danking 33a69b4
works maybe?
danking 950f154
simplify
danking a852c2f
wip
danking 16b1951
fix simple case
danking 89f0870
typo
danking f68b0b8
another bad test
danking 8b1815b
nope
danking b07b343
fix utf8 cast method
danking 6e4371e
remove DType borrow from ExtensionScalar
danking 48466c9
include target type in error
danking File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -334,7 +334,6 @@ impl<T: PStatsType> BitWidthAccumulator<T> { | |
|
|
||
| #[cfg(test)] | ||
| mod test { | ||
| use vortex_dtype::{DType, Nullability, PType}; | ||
| use vortex_scalar::Scalar; | ||
|
|
||
| use crate::array::primitive::PrimitiveArray; | ||
|
|
@@ -402,8 +401,7 @@ mod test { | |
| let arr = PrimitiveArray::from_option_iter([Option::<i32>::None, None, None]); | ||
| let min: Option<Scalar> = arr.statistics().compute(Stat::Min); | ||
| let max: Option<Scalar> = arr.statistics().compute(Stat::Max); | ||
| let null_i32 = Scalar::null(DType::Primitive(PType::I32, Nullability::Nullable)); | ||
| assert_eq!(min, Some(null_i32.clone())); | ||
| assert_eq!(max, Some(null_i32)); | ||
| assert_eq!(min, None); | ||
| assert_eq!(max, None); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was just wrong. I'm not really sure why it worked. |
||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,7 +3,7 @@ use std::sync::Arc; | |
| use enum_iterator::all; | ||
| use itertools::Itertools; | ||
| use vortex_dtype::{DType, Nullability, PType}; | ||
| use vortex_error::vortex_panic; | ||
| use vortex_error::{vortex_panic, VortexExpect as _}; | ||
| use vortex_scalar::{Scalar, ScalarValue}; | ||
|
|
||
| use crate::data::InnerArrayData; | ||
|
|
@@ -118,7 +118,7 @@ impl Statistics for ArrayData { | |
| let s = self | ||
| .encoding() | ||
| .compute_statistics(self, stat) | ||
| .ok()? | ||
| .vortex_expect("compute_statistics must not fail") | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Debatable but it's really annoying to debug compute_statistics errors without this. |
||
| .get(stat) | ||
| .cloned(); | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
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.
These were just wrong, min and max are never null.