open-sdg / sdg-build

Python package to convert SDG-related data and metadata between formats
MIT License
5 stars 23 forks source link

Don't cast 'None' to a string #209

Closed brockfanning closed 3 years ago

brockfanning commented 3 years ago

This recent change is causing Python's None to be converted into the string "None". I've noticed this in the case of an SDMX input (trying out Rwanda's data against 1.3.0-dev branches).

brockfanning commented 3 years ago

@jwestw @LucyGwilliamAdmin I think we may want to resolve this before 1.3.0. Lucy you can see the bug manifested in the Rwanda data if you build against the 1.3.0-dev branch. Here's what I did to test it out: https://github.com/brockfanning/sdg-data-rwanda/commit/4c2cc5c3089a346540d1b2fa59191b6896db354e

In the CSV that gets built, the string "None" appears all over the place, like:

Year,REF_AREA,SEX,AGE,URBANISATION,Value
2000,,None,None,None,58.9
2005,,None,None,None,56.7
2011,,None,None,None,44.9
2014,,None,None,None,39.1
2017,,None,None,None,38.2
2014,,M,Y_GE16,None,33.2
2017,,M,Y_GE16,None,31.6
2014,,F,Y_GE16,None,35.9
2017,,F,Y_GE16,None,34.8
etc...

But if I switch to using this branch, I don't see the problem.

LucyGwilliamAdmin commented 3 years ago

@brockfanning ahh I was also having this issue with a UK feature branch but didn't know it was an issue - I will try testing again