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-45344: [C++][Testing] Generic StepGenerator #45345

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

Conversation

zanmato1984
Copy link
Contributor

@zanmato1984 zanmato1984 commented Jan 24, 2025

Rationale for this change

#45344

What changes are included in this PR?

Make the StepGenerator generic.

Are these changes tested?

UT included.

Are there any user-facing changes?

None.

Copy link

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

@zanmato1984
Copy link
Contributor Author

Hi @pitrou @westonpace , does this make sense? Thanks.

ARROW_TESTING_EXPORT std::shared_ptr<ArrayGenerator> Step(T start = 0, T step = 1) {
class StepGenerator : public ArrayGenerator {
public:
// Use [[maybe_unused]] to avoid a compiler warning in Clang versions before 15 that
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 is weird but it seems to be a clang bug.

CI failure: https://github.com/apache/arrow/actions/runs/12952919478/job/36131370510?pr=45345

/arrow/cpp/src/arrow/testing/generator.h:313:11: error: unused type alias 'ArrowType' [-Werror,-Wunused-local-typedef]
    using ArrowType = typename CTypeTraits<T>::ArrowType;
          ^

A SO thread: https://stackoverflow.com/questions/50205243/clang-emits-an-unused-type-alias-warning-for-a-type-alias-that-is-used

Reproduction on Clang 14: https://godbolt.org/z/hsnh6cGh8

Clang 15 (works fine): https://godbolt.org/z/x5zTe7j64

@github-actions github-actions bot added awaiting committer review Awaiting committer review and removed awaiting review Awaiting review labels Jan 24, 2025
Copy link
Member

@westonpace westonpace left a comment

Choose a reason for hiding this comment

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

Looks like a cool and useful utility. Thanks!

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting committer review Awaiting committer review labels Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants