d3-dsv icon indicating copy to clipboard operation
d3-dsv copied to clipboard

autoType should infer "TRUE" or "FALSE" as booleans

Open bothness opened this issue 11 months ago • 2 comments

When working with Excel or Google Sheets, boolean values are by default exported to DSV files as uppercase "TRUE" or "FALSE" strings.

It would therefore seem sensible for the autoType function not to be case sensitive when parsing booleans from strings rather than only accepting lowercase. "true", "TRUE" or perhaps even "tRUe" should become true.

bothness avatar May 24 '25 14:05 bothness

I don't disagree on the all-caps values (and while I see no reason to support tRUe, I think that True could be generated by python). However this would be a breaking change, so we'd have to carefully weigh the pros and cons.

Fil avatar Jun 02 '25 13:06 Fil

Thanks @Fil. I guess I'll put my own polyfill together for now. Would be great if this could be considered for the next major version.

bothness avatar Jun 03 '25 12:06 bothness