Skip to content

refactor: parameterize CSV and Avro tests - #12361

Closed
Phoenix500526 wants to merge 2 commits into
apache:mainfrom
Phoenix500526:issue/12328-IV
Closed

Phoenix500526 wants to merge 2 commits into
apache:mainfrom
Phoenix500526:issue/12328-IV

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 CSV and Avro tests repeat setup and assertions or bury independent scenarios in nested loops. Named rstest cases make failures easier to identify and keep related inputs and expectations together.

What changes are included in this PR?

  • Parameterize CSV buffered reads, decimal reads, custom input formats, whitespace handling, writer options, and truncated-row counts.
  • Parameterize Avro fingerprint handling, timestamp and duration codecs, decimal decoding, schema projection and null ordering, and selected asynchronous reader options.
  • Add rstest as a development dependency to both crates.

Are these changes tested?

The refactoring retains the existing behavioral scenarios, including CSV buffer-size combinations and default writer configuration, Avro feature-dependent decimal and duration behavior, Id64 values beyond 32 bits, and empty-schema batch boundaries. Assertions continue to check values, types, errors, and output formats as appropriate.

Local validation passed for all 127 CSV unit tests and 14 documentation tests, and for 421 Avro unit tests with default features and 493 with all features. Formatting, spelling, and relevant Clippy checks also passed.

Are there any significant user-facing changes?

No. These changes affect tests and development dependencies only.

AI usage disclosure

I worked through the CSV and Avro test groups with Codex, selected the refactors, and wrote or revised parts of the tests myself. I questioned case naming, comments, and input choices, including the distinction between 32-bit and 64-bit fingerprint IDs and the timestamp inputs shared by local and timezone-aware cases. I requested reviews and validation as the changes progressed.

Codex helped identify candidates, draft and revise parts of the implementation, cross-check coverage, run validation commands, and prepare the PR description.

Make individual scenarios easier to identify while preserving existing
coverage and reducing duplicated test logic.

Refs apache#12328
Make individual scenarios easier to identify while preserving existing
coverage and reducing duplicated test logic.

Refs apache#12328
@Phoenix500526

Copy link
Copy Markdown
Contributor Author

Closed temporarily and reopen after #12358 is merged.

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

Labels

arrow-avro arrow-avro crate arrow-csv arrow-csv crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor arrow-avro tests with rstest Refactor arrow-csv tests with rstest

1 participant