Skip to content
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

feat: SparseArray uses ScalarValue instead of Scalar #955

Merged
merged 3 commits into from
Oct 1, 2024

Conversation

danking
Copy link
Member

@danking danking commented Oct 1, 2024

No description provided.

@danking danking requested review from lwwmanning and removed request for robert3005 October 1, 2024 15:38
@danking danking force-pushed the dk/cleanup-metadata--sparse-array-uses-scalarvalue branch from 14215be to bc67a80 Compare October 1, 2024 16:19
@danking danking enabled auto-merge (squash) October 1, 2024 16:29
Some(idx) => scalar_at_unchecked(&self.values(), idx).cast(self.dtype()),
}
Ok(match self.search_index(index)?.to_found() {
None => self.fill_owned_scalar(),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think fill_scalar is a better name for this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

) -> VortexResult<Self> {
if !matches!(indices.dtype(), &DType::IDX) {
vortex_bail!("Cannot use {} as indices", indices.dtype());
}
if values.dtype() != fill_value.dtype() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be nice to keep a check like this but would have to add method to dtype to check if it is a valid scalar value for the type

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danking danking merged commit df77be3 into develop Oct 1, 2024
5 checks passed
@danking danking deleted the dk/cleanup-metadata--sparse-array-uses-scalarvalue branch October 1, 2024 17:44
@danking danking mentioned this pull request Oct 2, 2024
21 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants