chore(rust): Add proptest
strategies for Series physical types
#24549
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves the first part of the Series checklist in: #23448.
The
#[allow(unused_mut)]
will be removed once I expand the functionality to the other Series strategies.I tried a more compact technique for selecting types with several options, like
UINT
andINT
. In previous iterations, I would make a bitflag for each respective variant (UInt8, UInt32, etc.) and then a match arm for if they got selected. In this iteration, to prevent repetition, I only have one flag forINT
/UINT
/FLOAT
and onematch
arm. The arm goes into a strategy that randomly selects one of the variants usingproponeof!
.If this is accepted, I can go back to the
proptest
strategies forDataType
andAnyValue
and refactor them to make it a bit shorter and less boilerplate. This would also remove the need fornth_set_bit_u64()
.Let me know your thoughts. Thank you!