uwdata / arquero

Query processing and transformation of array-backed data tables.
https://idl.uw.edu/arquero/
BSD 3-Clause "New" or "Revised" License
1.29k stars 63 forks source link

CSV parse functions don't get run on null values #321

Open ghing opened 1 year ago

ghing commented 1 year ago

The parse function passed as options to methods like loadCSV() only get called on non-null values. I learned this when parsing data exported from a system that represents values from a checkbox widget as 1 if the box is checked and null otherwise. I wanted to convert these to true or false using a function to parse the values on load. However, this function only got called on the non-null values. There are a number of workarounds (parse values outside of Arquero, do it after load with table.derive(), fill null values with false), but it would have been nice to understand why my code wasn't behaving as expected.

There are a number of workarounds, but it would either be helpful to document this behavior, or change it to call the parser on all values. I'm assuming skipping null values is an optimization, so if the path forward is a documentation mention, I can submit a PR with how I'd phrase it in the API docs.