Skip to content

test(arrow-cmp): parameterize comparison tests - #12433

Closed
Phoenix500526 wants to merge 1 commit into
apache:mainfrom
Phoenix500526:rstest/arrow-cmp
Closed

Phoenix500526 wants to merge 1 commit into
apache:mainfrom
Phoenix500526:rstest/arrow-cmp

Conversation

@Phoenix500526

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Closes #12432.

Part of #12328.

Rationale for this change

Repeated comparator setup and assertions make the supported type and sorting combinations harder to follow. Named rstest cases expose those combinations individually and share the common test bodies.

What changes are included in this PR?

  • Parameterize Decimal and primitive dictionary comparisons while retaining each type's original values and precision settings.
  • Parameterize dictionary sorting and null handling across byte types and FixedSizeBinary, retaining the default sorting configuration where it was originally used.
  • Parameterize List, ListView, Struct, Map, and Dense Union sorting scenarios with explicit expected results. Keep Map/List consistency checks across all sorting configurations and row pairs.
  • Separate Decimal scale mismatch checks from the successful comparison of differing precisions. Retain the Decimal128 error message and nested dictionary checks.
  • Add rstest as an arrow-cmp development dependency with default features disabled.

Are these changes tested?

The refactoring preserves the original inputs, sort configurations, comparison indices, expected orderings, and error checks. Existing Miri exclusions are unchanged. The all-features arrow-cmp suite passes locally with 98 tests; Clippy and formatting checks also pass.

Are there any significant user-facing changes?

No. Production code and public APIs are unchanged.

AI usage disclosure

I worked through the candidate test groups individually with Codex, chose which refactors to include, and reviewed the proposed code. I discussed the generic type constraints and type markers, requested that all expected comparison results be explicit in the cases, and reviewed coverage and validation results before approving the commit.

Codex helped identify candidates, implement and revise the parameterized tests, compare inputs and assertions with the originals, run validation, and draft this issue and PR description.

Reduce duplicated comparison checks while preserving the existing
inputs, sort configurations, and expected results.

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-cmp tests with rstest

1 participant