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

Return ScalarBuffer from PrimitiveArray::values (#3879) #3896

Merged
merged 3 commits into from
Mar 22, 2023

Conversation

tustvold
Copy link
Contributor

Which issue does this PR close?

Part of #3879

Rationale for this change

Continues the process of making arrays wrappers around strongly typed buffer abstractions, in a similar vein to #3895

What changes are included in this PR?

Are there any user-facing changes?

Yes, it changes the return type of PrimitiveArray::values. I opted to just break this API instead of deprecating, as I wanted to keep the name the same.

@tustvold tustvold added the api-change Changes to the arrow API label Mar 21, 2023
@tustvold tustvold requested review from viirya and alamb March 21, 2023 19:18
@github-actions github-actions bot added the arrow Changes to the arrow crate label Mar 21, 2023
@@ -69,7 +69,7 @@
//!
//! let collected: Vec<_> = array.iter().collect();
//! assert_eq!(collected, vec![Some(1), None, Some(3)]);
//! assert_eq!(array.values(), [1, 0, 3])
//! assert_eq!(array.values(), &[1, 0, 3])
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't work out how to make this work as before, tbh I'm somewhat confused how it was working before...

@@ -277,7 +277,7 @@ impl<T: ArrowPrimitiveType> PrimitiveArray<T> {

/// Returns a slice of the values of this array
Copy link
Member

Choose a reason for hiding this comment

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

Also update the doc?

@tustvold tustvold merged commit a498a03 into apache:master Mar 22, 2023
spebern pushed a commit to spebern/arrow-rs that referenced this pull request Mar 25, 2023
…#3896)

* Return ScalarBuffer from PrimitiveArray::values (apache#3879)

* Fix docs

* Review feedback
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-change Changes to the arrow API arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants