azavea / pfb-network-connectivity

PFB Bicycle Network Connectivity
Other
40 stars 10 forks source link

Handle null 'city_fips' values in batch shapefile import #831

Closed KlaasH closed 3 years ago

KlaasH commented 3 years ago

The code that loads neighborhoods from a batch shapefile looks for a city_fips property to load. If the property is absent, it gets empty string, which works fine. It clears the value on an existing neighborhood, which seems correct. If the property is there but null, though, it gets None and tries to save that to the neighborhood, which is not allowed and produces an error from the database.

We should add a check after the line where the value gets loaded to set it to empty string if it comes back as None.