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

GH-44541: [C++] NumericArray<T> should not use ctor from parent directly #44542

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

Conversation

mapleFU
Copy link
Member

@mapleFU mapleFU commented Oct 28, 2024

Rationale for this change

See #44541

What changes are included in this PR?

NumericArray<T> not using child's ctor.

Are these changes tested?

Yes

Are there any user-facing changes?

Bugfix

@mapleFU mapleFU requested review from pitrou and bkietz October 28, 2024 11:16
@mapleFU
Copy link
Member Author

mapleFU commented Oct 28, 2024

@pitrou @bkietz @felipecrv
cc @wgtmac

Copy link

⚠️ GitHub issue #44541 has been automatically assigned in GitHub to PR creator.

@@ -119,8 +129,6 @@ class NumericArray : public PrimitiveArray {
IteratorType end() const { return IteratorType(*this, length()); }

protected:
using PrimitiveArray::PrimitiveArray;
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to add NumericArray() if this line is deleted?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nice catch 🤔

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Oct 28, 2024
@wgtmac wgtmac changed the title GH-44541: [C++] NumericArray<T> should not use child's ctor directly GH-44541: [C++] NumericArray<T> should not use ctor from parent directly Oct 28, 2024
@@ -585,6 +585,18 @@ TEST_F(TestArray, TestValidateNullCount) {
}
}

TEST_F(TestArray, TestValidValues) {
Copy link
Member

Choose a reason for hiding this comment

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

Should we add a test case for TimestampArray specifically?

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

Copy link
Member

@wgtmac wgtmac left a comment

Choose a reason for hiding this comment

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

+1. Thanks!

@@ -119,7 +129,7 @@ class NumericArray : public PrimitiveArray {
IteratorType end() const { return IteratorType(*this, length()); }

protected:
Copy link
Member

Choose a reason for hiding this comment

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

The use of protected is odd here; nothing inherits from NumericArray inside arrow. Is it intended to support user subclassing of NumericArray? Or could we just mark NumericArray final? @pitrou

Copy link
Member Author

Choose a reason for hiding this comment

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

This might keep same style from PrimitiveArray, which initializes raw_values_ in ctor. Don't know should we change here

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting committer review Awaiting committer review labels Oct 28, 2024
@mapleFU
Copy link
Member Author

mapleFU commented Nov 3, 2024

Gentle ping @pitrou

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants