Skip to content

test(arrow-ord): refactor comparison and rank tests - #12436

Closed
Phoenix500526 wants to merge 2 commits into
apache:mainfrom
Phoenix500526:rstest/arrow-ord-II
Closed

Phoenix500526 wants to merge 2 commits into
apache:mainfrom
Phoenix500526:rstest/arrow-ord-II

Conversation

@Phoenix500526

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Part of #12434 and #12328. This is the comparison and ranking portion of the arrow-ord refactor; the sorting changes are in #12435. Neither PR closes #12434 on its own.

Rationale for this change

Comparison and ranking tests repeat setup and assertions for operators, array types, and sort options. Named rstest cases make each scenario easier to identify and run while sharing the repeated test body.

What changes are included in this PR?

  • Add rstest as a dev dependency, using the same small dependency commit as the sorting PR.
  • Parameterize selected Boolean, numeric, Binary, string, dictionary, Decimal, NaN, and run-end-encoded comparisons in comparison.rs and cmp.rs.
  • Parameterize ranking options and byte-array types in rank.rs, keeping nonzero null-payload checks separate and retaining inline-view buffer assertions.

Preserve scalar/array distinctions, dictionary key types, both comparison directions where originally tested, exact expected results, and Miri exclusions. The pre-existing missing millisecond Timestamp case is left for a separate change.

Are these changes tested?

Before/after tracing matched all 531 comparison calls in comparison.rs, including operators, scalar flags, types, null bitmaps, and underlying buffer data. Ranking and REE scenarios were checked against the original assertions. The arrow-ord all-features unit and documentation tests pass on this branch independently. Miri ignore propagation was checked in macro-expanded tests; Miri itself was not run.

Are there any significant user-facing changes?

No. Production code and public APIs are unchanged.

AI usage disclosure

I worked through the candidate tests with Codex in an iterative, test-by-test discussion. I selected the groups to refactor, reviewed the proposed parameterization and diffs, discussed generic types and coverage, and explicitly kept the Timestamp coverage gap separate. I also chose the commit and PR split. Codex assisted with implementation, before/after coverage checks, Miri attribute checks, and local validation. I reviewed scope and design decisions throughout the process.

Enable parameterized tests with individually reported cases.

Refs apache#12328
Reduce repeated test setup and make failures identify their cases.
Preserve existing comparison coverage and Miri exclusions.

Refs apache#12328
@boring-cyborg boring-cyborg Bot added the arrow-kernels Crates that transform arrow data (e.g. compute, cast) label Nov 24, 2026
@Jefffrey

Copy link
Copy Markdown
Contributor

@Phoenix500526 could i ask you to close some of your PRs? you currently have 23 (!) PRs open, and even though only 3 of them are non-draft, this is a substantial amount to have open at one time and it looks like spam. could you reduce to a more manageable number so we know which to focus on? for example, the rstest ones probably should all be closed until we merge the first rstest one so we know which one we're supposed to focus on

@Phoenix500526

Copy link
Copy Markdown
Contributor Author

@Phoenix500526 could i ask you to close some of your PRs? you currently have 23 (!) PRs open, and even though only 3 of them are non-draft, this is a substantial amount to have open at one time and it looks like spam. could you reduce to a more manageable number so we know which to focus on? for example, the rstest ones probably should all be closed until we merge the first rstest one so we know which one we're supposed to focus on

Sure. Sorry for overwhelming the review queue. I had been using draft PRs to queue follow-up work, but I understand that having so many open makes it harder to prioritize reviews. I'll close the other rstest PRs and keep #12354 as the one to focus on. Once that lands, I'll apply the feedback to the remaining work and reopen it in smaller batches. I'll also review my other open PRs to reduce the overall number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arrow-kernels Crates that transform arrow data (e.g. compute, cast)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor arrow-ord tests with rstest

2 participants