Repository navigation
Commit 75ddead
authored
Deprecate CsvSource::newlines_in_values and preserve proto coverage (#26179)
## Which issue does this PR close?
- Part of #24612
## Rationale for this change
Deprecate `CsvSource::newlines_in_values()` as part of the CSV API
cleanup while preserving compatibility and existing CSV serialization
behavior.
The getter simply returns
`CsvOptions.newlines_in_values.unwrap_or(false)`. There is no
replacement getter, so callers should retain their original `CsvOptions`
when they need to inspect this setting.
The public getter remains callable during the deprecation window, and
CSV reading and repartitioning behavior are unchanged.
## What changes are included in this PR?
- Mark `CsvSource::newlines_in_values()` as deprecated starting in
56.0.0, with an accurate migration note.
- Replace the internal encoder's getter call with
`self.options.newlines_in_values.unwrap_or(false)`, preserving the
existing boolean mapping.
- Extend `roundtrip_csv_scan_preserves_format_options` to cover
`Some(true)`, `Some(false)`, and `None`.
- Assert the protobuf `CsvScan.newlines_in_values` field after
round-tripping the physical plan, while retaining all existing CSV
format-option assertions.
- Preserve malformed terminator validation for empty and two-byte
terminators.
- Document the deprecation and migration guidance in the 56.0.0 upgrade
guide.
No protobuf wire-format changes or new public APIs are introduced.
## Are these changes tested?
Extended `roundtrip_csv_scan_preserves_format_options` to verify:
- `Some(true)` serializes as `true`.
- `Some(false)` serializes as `false`.
- `None` serializes as `false`.
- Existing CSV format options, including delimiter, quote, escape,
comment, terminator, truncated rows, header, and GZIP compression,
survive the round-trip.
- Invalid zero-byte and two-byte terminators continue to produce
decoding errors.
The patch includes these regression tests, but does not establish
whether they have been executed successfully.
Recommended verification commands:
```bash
cargo test -p datafusion-proto --test proto_integration roundtrip_csv_scan_preserves_format_options
cargo test -p datafusion-datasource-csv
cargo fmt --all
cargo clippy --all-targets --all-features -- -D warnings
./ci/scripts/doc_prettier_check.sh --write --allow-dirty
```
## Are there any user-facing changes?
`CsvSource::newlines_in_values()` is deprecated starting in 56.0.0 but
remains callable with unchanged behavior.
Existing callers may receive deprecation warnings, potentially affecting
downstream builds that treat warnings as errors.
There is no replacement getter. Callers should retain the `CsvOptions`
used to configure the source and read
`options.newlines_in_values.unwrap_or(false)`.
The 56.0.0 upgrade guide documents this migration.
CSV parsing, repartitioning, and protobuf serialization behavior are
unchanged.
## LLM-generated code disclosure
This PR includes LLM-generated code and comments. All LLM-generated
content has been manually reviewed.1 parent a4b8198 commit 75ddead
3 files changed
Lines changed: 97 additions & 66 deletions
File tree
- datafusion
- datasource-csv/src
- proto/tests/cases/plans
- docs/source/library-user-guide/upgrading
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
177 | 181 | | |
178 | 182 | | |
179 | 183 | | |
| |||
354 | 358 | | |
355 | 359 | | |
356 | 360 | | |
357 | | - | |
| 361 | + | |
358 | 362 | | |
359 | 363 | | |
360 | 364 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
591 | 561 | | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
596 | 592 | | |
597 | | - | |
| 593 | + | |
598 | 594 | | |
599 | 595 | | |
600 | 596 | | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
607 | | - | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
608 | 621 | | |
609 | 622 | | |
610 | 623 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
118 | 132 | | |
119 | 133 | | |
120 | 134 | | |
| |||
0 commit comments