CartoDB / observatory-extension

BSD 3-Clause "New" or "Revised" License
6 stars 4 forks source link

Make OBS_GetMeasure (and probably others) resilient to null inputs #178

Closed rafatower closed 8 years ago

rafatower commented 8 years ago

When running analyses we get sometimes this error:

Traceback (most recent call last):
1
File "<string>" line 20 in __plpython_procedure_obs_getmeasure_17089676 [locals]
RaiseException: cdb_dataservices_server._obs_getmeasure(7): [obs_2016_07_18_1d86d3f2ec] REMOTE ERROR: Invalid geometry type (<NULL>), can only handle 'ST_Point', 'ST_Polygon', and 'ST_MultiPolygon'

because of some null values in the_geom. We should make it resilient to null inputs.

rafatower commented 8 years ago

My suggestion is to just return NULL on such inputs.

Probably more methods are to be modified to prevent errors.