BurntSushi / BurntSushi/rust-csv

permit caller to define "nullable" semantics

Open
#167 1 comment 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
2k
Forks
257
PR merge metrics
No merged PRs in 30d

Description

Currently, the Serde deserializer in this crate hardcodes specific nullable semantics. Namely, only fields with an empty value are considered missing. But, it is fairly common in CSV formats to use other sentinels, such as "null," even for otherwise non-String fields. It should be possible to augment `ReaderBuilder` to permit the caller to provide a predicate that determines whether a field value is missing or not.

Once we have the predicate, it should be as simple as plumbing it through and calling it in [`deserialize_option`](https://github.com/BurntSushi/rust-csv/blob/fcdbea357739348b9eed2a0239e180213be78af9/src/deserializer.rs#L453-L465).

See also https://users.rust-lang.org/t/serde-csv-empty-fields-are-the-string-null/31260 for motivation.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.