Closed smotornyuk closed 1 year ago
You are right, but perhaps the check needs to be made one level above, on the index_dataset()
function of the different backends (in addition to the parse_geojson()
one):
geom_from_metadata = dataset_dict.get("spatial")
if not geom_from_metadata:
return dataset_dict
geometry = self.parse_geojson(geom_from_metadata)
Basically I don't want to log an error for each dataset that doesn't have a spatial
extra, there are plenty of instances that combine spatial and non-spatial datasets
Sorry, it took me ages to change just a couple of lines:)
Problem: There is an assumption in the code that geometry may be missing from the metadata
But code doesn't handle TypeError which is raised in this case.
Solution: Skip an attempt to parse missing geometry as a JSON value + explicitly notify user about missing geometry.