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

Deprecate Array::data_ref (#3880) #3923

Merged
merged 1 commit into from
Mar 28, 2023

Conversation

tustvold
Copy link
Contributor

Which issue does this PR close?

Part of #3880

Rationale for this change

Continues the process of gradually removing the need for arrays to store ArrayData directly

What changes are included in this PR?

Are there any user-facing changes?

@github-actions github-actions bot added the arrow Changes to the arrow crate label Mar 23, 2023
.validate_decimal_precision(array.precision())
.unwrap_err();

let array = Decimal128Array::from(vec![123456_i128]);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test dates from before decimals were just a PrimitiveArray - we've come a long way in terms of ergonomics 😅

@tustvold tustvold force-pushed the deprecate-array-data-ref branch from 2801ce8 to 12ee185 Compare March 23, 2023 22:59
@tustvold tustvold force-pushed the deprecate-array-data-ref branch from 12ee185 to 71be2e7 Compare March 23, 2023 23:07
@@ -3502,14 +3495,13 @@ where

// wrap up
let builder = ArrayData::builder(out_dtype)
.offset(array.offset())
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unlike before using value_offsets takes into account any offset

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

I love this PR -- the reduction of unsafe is really nice!

@@ -3484,14 +3484,7 @@ where
_ => unreachable!(),
};

// Safety:
Copy link
Contributor

Choose a reason for hiding this comment

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

🎉

@tustvold tustvold merged commit 151ce6f into apache:master Mar 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arrow Changes to the arrow crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants