DataBiosphere / data-explorer

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

Searching for a facet with all null values causes a 500 error #279

Closed wnojopra closed 5 years ago

wnojopra commented 5 years ago

For amp_pd there are a few columns for sample metrics that are all null. Searching for these causes this error:

apise_1_5800c725a6d1 | File "/app/data_explorer/controllers/facets_controller.py", line 72, in facets_get apise_1_5800c725a6d1 | _process_extra_facets(extraFacets) apise_1_5800c725a6d1 | File "/app/data_explorer/controllers/facets_controller.py", line 48, in _process_extra_facets apise_1_5800c725a6d1 | es, elasticsearch_field_name, field_type) apise_1_5800c725a6d1 | File "/app/data_explorer/util/elasticsearch_util.py", line 314, in get_elasticsearch_facet apise_1_5800c725a6d1 | field_type) apise_1_5800c725a6d1 | File "/app/data_explorer/util/elasticsearch_util.py", line 53, in _get_bucket_interval apise_1_5800c725a6d1 | field_range = _get_field_range(es, field_name) apise_1_5800c725a6d1 | File "/app/data_explorer/util/elasticsearch_util.py", line 49, in _get_field_range apise_1_5800c725a6d1 | return (aggs['max']['value'] - aggs['min']['value']) apise_1_5800c725a6d1 | TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'

Lets fix this so that it just displays 0 values instead.