Skip to content

test(arrow-ord): refactor sorting tests with rstest - #12435

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

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

Conversation

@Phoenix500526

@Phoenix500526 Phoenix500526 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

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

Rationale for this change

Sorting tests repeat setup and assertions across types, null placement, sort direction, and limit boundaries. Named rstest cases make individual failures easier to locate and rerun while reducing duplicated test bodies.

What changes are included in this PR?

  • Add rstest as a dev dependency, using a shared workspace declaration with default features disabled.
  • Parameterize selected primitive, Boolean, string, Binary, dictionary, Decimal, List, and lexicographic sorting tests in sort.rs.
  • Inline helpers that have only one remaining caller and retain helpers used by multiple tests.

Keep the original inputs, expected results, precision/scale settings, default and explicit sort options, limits, and Miri exclusions. Shared randomized tests remain unchanged. The pre-existing repeated Int16 scenario is retained.

Are these changes tested?

The refactored cases were checked against the original inputs and assertions, including nulls, NaN, Decimal256 extrema, and partial sorting. 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 chose which groups to refactor, reviewed the proposed case groupings and diffs, questioned coverage and helper structure, requested that single-use helpers be inlined, and decided how to split the work into independent PRs. Codex assisted with implementation, before/after coverage checks, Miri attribute checks, and local validation. I reviewed the scope and design decisions throughout the process.

Enable parameterized tests with individually reported cases.

Refs apache#12328
Make sorting scenarios independently identifiable while retaining
existing inputs, expected results, 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
@Phoenix500526

Copy link
Copy Markdown
Contributor Author

Closed temporarily

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

1 participant