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

Introduce UnsafeFlag to manage disabling ArrayData validation #7027

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alamb
Copy link
Contributor

@alamb alamb commented Jan 27, 2025

Which issue does this PR close?

Rationale for this change

As mentioned previously, the management of disabling validation must be handled very carefully to ensure the overall API remains safe.

@tustvold suggested an approach that adds additional compile time checking in #7006 (review), in the form of an an extra layer of protection when modifying the flags. I thought it was a great idea so figured I would start with it here

What changes are included in this PR?

  1. Introduce the UnsafeFlag type
  2. Update ArrayDataBuilder to use it

Are there any user-facing changes?

No, this is entirely internal

@github-actions github-actions bot added the arrow Changes to the arrow crate label Jan 27, 2025
Self(false)
}

#[inline]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the point of structure is that the compiler enforces it can only ever be set to true via unsafe code

@alamb alamb changed the title Introduce UnsafeFlag to manage disabling validation Introduce UnsafeFlag to manage disabling ArrayData validation Jan 27, 2025
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