GSA / ckanext-geodatagov

data.gov extension
Other
36 stars 39 forks source link

Fix last trailing decimal + first leading zero #254

Closed nickumia-reisys closed 1 year ago

nickumia-reisys commented 1 year ago

Related to

Notes:

nickumia-reisys commented 1 year ago

@jbrown-xentity How do we want to handle the case of no commas? (i.e. -149.0 -81.0 -149.0 -81.0)

jbrown-xentity commented 1 year ago

@jbrown-xentity How do we want to handle the case of no commas? (i.e. -149.0 -81.0 -149.0 -81.0)

Not sure we should, though the docs are a little unclear. Can you check and see if we have a test case covering the above use case? If so, then we should handle it. If not, we should allow an error to be thrown. Then we can either throw the whole record out, or ignore the spatial field (but keep the value in old_spatial).

nickumia-reisys commented 1 year ago

We don't have a test for that currently: https://github.com/GSA/ckanext-geodatagov/blob/main/ckanext/geodatagov/tests/test_fix_spatial.py image image

jbrown-xentity commented 1 year ago

Alright, then let's say that is a bad value. I think best practice is to make spatial be blank/null, and keep old_spatial as the originally sent value. Let's not throw out the whole record, as this logic is setting between the harvester and the CKAN stuff.