Skip to content

refactor: parameterize arrow-json tests - #12358

Closed
Phoenix500526 wants to merge 1 commit into
apache:mainfrom
Phoenix500526:issue/12328-III
Closed

Phoenix500526 wants to merge 1 commit into
apache:mainfrom
Phoenix500526:issue/12328-III

Conversation

@Phoenix500526

@Phoenix500526 Phoenix500526 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Part of #12328.

Rationale for this change

Several arrow-json tests repeat setup and assertions or group independent scenarios in a single test. Named rstest cases make failures easier to identify and keep shared test logic in one place.

What changes are included in this PR?

  • Add rstest as a development dependency with default features disabled.
  • Parameterize reader tests for string and timestamp types, Struct decoding, and run-end encoded nullability.
  • Separate decoder state preservation checks from invalid-input cases, and group tape errors by decode, truncation, and UTF-8 failure stages.
  • Parameterize Decimal encoding, fallback encoder null handling, empty writer output, and Struct JSON round trips.

Are these changes tested?

The refactored tests preserve the original inputs, parameter combinations, and expected results, including full error messages, Decimal precision and scale differences, and default implicit-null configuration. Truncated-record cases also check that the decoder retains a partial row and its buffered row count.

All 187 arrow-json unit tests and 19 documentation tests pass with all features enabled. Clippy, formatting, and spelling checks also pass.

Are there any significant user-facing changes?

No. This changes tests and development dependencies only.

AI usage disclosure

I reviewed the proposed refactors group by group and selected the scope of this PR. I directed the work to preserve existing coverage and to separate tests of different behaviors, including decoder state preservation and invalid-input handling, rather than mechanically combine all scenarios.

Codex helped identify duplicated tests, draft and revise the implementation, compare coverage with the original tests, run validation commands, and prepare the PR description.

@boring-cyborg boring-cyborg Bot added the arrow-json arrow-json crate label Nov 20, 2026
Make individual scenarios easier to identify while preserving existing
coverage and reducing duplicated test logic.

Refs apache#12328
@Phoenix500526

Phoenix500526 commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor Author

I'll temporarily close the other rstest PRs and reopen them in smaller batches after #12357 is merged.

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

Labels

arrow-json arrow-json crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor arrow-json tests with rstest

1 participant