hotosm / galaxy-api

Backend to fetch data from Underpass
https://galaxy-api.hotosm.org/latest/redoc
GNU Affero General Public License v3.0
14 stars 5 forks source link

Added better validation for None value : User Stats #243

Closed kshitijrajsharma closed 2 years ago

kshitijrajsharma commented 2 years ago

While going through the mentioned issue , I figured out we were skipping row if any of element value is None in stats , This PR Improves the None validation and only replace respective key value instead of skipping whole row

Previous Approach : Skipping Whole row if any element of the stat is None Current Approach : Replacing None stats with 0 while keeping other non zero stats

( For eg : if addedBuildings : None , ModifiedBuildings : 5 , Now with current approach it will show stat for modified 5 and added as 0 and will not skip the row and will not return empty array if any of element value is None , Previously we were skipping full row any of None value is found and returning empty array )