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 NullBuilder capacity, as it behaves in a surprising way #5721

Merged
merged 3 commits into from
May 4, 2024

Conversation

HadrienG2
Copy link
Contributor

@HadrienG2 HadrienG2 commented May 4, 2024

Which issue does this PR close?

Closes #5711.

Rationale for this change

It seems everyone at #5711 has so far agreed that having NullBuilder::with_capacity() set the builder length is surprising / feels like a bug, and that the notion of capacity makes no sense for this builder in general. Therefore, this PR is deprecating the notion of NullBuilder capacity where possible, and ignoring capacity in NullBuilder::with_capacity() and NullArray::builder() to remove the buggy behavior.

What changes are included in this PR?

  • NullBuilder::with_capacity() and NullBuilder::capacity() are deprecated.
  • NullBuilder::with_capacity() and NullArray::builder() are switched to the more sensible behavior of ignoring input capacity instead of setting a nonzero initial builder length.

Are there any user-facing changes?

Both changes listed above are user-facing.

Although it does affect API semantics, I don't think making NullBuilder::with_capacity() and NullArray::builder() ignore their argument should be considered a breaking change, beacause the current behavior of setting the length was considered to be a bug in #5711 discussion.

@github-actions github-actions bot added the arrow Changes to the arrow crate label May 4, 2024
@tustvold tustvold merged commit d9206ba into apache:master May 4, 2024
24 of 25 checks passed
@tustvold
Copy link
Contributor

tustvold commented May 4, 2024

Integration failure is unrelated

@HadrienG2 HadrienG2 deleted the deprecate-null-capacity branch May 5, 2024 04:42
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.

What is the rationale for the current NullBuilder capacity behavior?
2 participants