Skip to content

Adds fine-grained empty value preservation options#14

Merged
vethman merged 1 commit into
mainfrom
preserve-empty-options
Apr 9, 2026
Merged

Adds fine-grained empty value preservation options#14
vethman merged 1 commit into
mainfrom
preserve-empty-options

Conversation

@vethman

@vethman vethman commented Apr 9, 2026

Copy link
Copy Markdown
Member

Introduces two new configuration options to control how empty CSV values are handled in the parsed output:

  • preserveEmptyColumnAsEmptyString: Controls unquoted empty cells (e.g., ,,)
  • preserveEmptyString: Controls explicitly quoted empty strings (e.g., "")

By default, unquoted empties are omitted while quoted empties are preserved as empty strings. This allows users to differentiate between "no value provided" and "explicitly empty" in their CSV data.

Implements a clear precedence chain: defaultValues > nullValues > preservation options > omit. Both parser implementations (string-based and stream-based) support these options consistently.

The implementation uses internal provenance tracking to distinguish between quoted and unquoted empty values during parsing, ensuring accurate preservation behavior without breaking existing functionality.

Introduces two new configuration options to control how empty CSV values are handled in the parsed output:

- `preserveEmptyColumnAsEmptyString`: Controls unquoted empty cells (e.g., `,,`)
- `preserveEmptyString`: Controls explicitly quoted empty strings (e.g., `""`)

By default, unquoted empties are omitted while quoted empties are preserved as empty strings. This allows users to differentiate between "no value provided" and "explicitly empty" in their CSV data.

Implements a clear precedence chain: defaultValues > nullValues > preservation options > omit. Both parser implementations (string-based and stream-based) support these options consistently.

The implementation uses internal provenance tracking to distinguish between quoted and unquoted empty values during parsing, ensuring accurate preservation behavior without breaking existing functionality.
@vethman vethman merged commit 5930846 into main Apr 9, 2026
4 checks passed
@vethman vethman deleted the preserve-empty-options branch April 9, 2026 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants