-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
base: main
Are you sure you want to change the base?
Conversation
|
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 |
There was a problem hiding this comment.
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
There was a problem hiding this 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!
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.
StepGenerator
for test data generation #45344