Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix persisting nan values in EJR #632
EJR update job_id='j-24011972cfb04efcb15e28d0b230a23b' data={'costs': 5.0, 'usage': {'cpu': {'value': 4033, 'unit': 'cpu-seconds'}, 'memory': {'value': 9359879, 'unit': 'mb-seconds'}, 'input_pixel': {'value': 0.0625, 'unit': 'mega-pixel'}}, 'results_metadata': {'geometry': {'type': 'Polygon', 'coordinates': [[[4.825919, 51.259766], [4.825919, 51.307638], [4.859629, 51.307638], [4.859629, 51.259766], [4.825919, 51.259766]]]}, 'bbox': [4.825919, 51.259766, 4.859629, 51.307638], 'area': {'value': 12526090.219329834, 'unit': 'square meter'}, 'start_datetime': '2017-11-01T00:00:00Z', 'end_datetime': '2017-11-01T00:00:00Z', 'links': [{'href': 'urn:eop:VITO:PROBAV_S10_TOC_333M_COG_V2:PROBAV_S10_TOC_X18Y02_20171101_333M_V201', 'rel': 'derived_from', 'title': 'Derived from urn:eop:VITO:PROBAV_S10_TOC_333M_COG_V2:PROBAV_S10_TOC_X18Y02_20171101_333M_V201', 'type': 'application/json'}, {'href': 'urn:eop:VITO:PROBAV_S10_TOC_333M_COG_V2:PROBAV_S10_TOC_X18Y02_20171101_333M_V201', 'rel': 'derived_from', 'title': 'Derived from urn:eop:VITO:PROBAV_S10_TOC_333M_COG_V2:PROBAV_S10_TOC_X18Y02_20171101_333M_V201', 'type': 'application/json'}, {'href': 'urn:eop:VITO:PROBAV_S10_TOC_333M_COG_V2:PROBAV_S10_TOC_X18Y02_20171101_333M_V201', 'rel': 'derived_from', 'title': 'Derived from urn:eop:VITO:PROBAV_S10_TOC_333M_COG_V2:PROBAV_S10_TOC_X18Y02_20171101_333M_V201', 'type': 'application/json'}, {'href': 'urn:eop:VITO:PROBAV_S10_TOC_333M_COG_V2:PROBAV_S10_TOC_X18Y02_20171101_333M_V201', 'rel': 'derived_from', 'title': 'Derived from urn:eop:VITO:PROBAV_S10_TOC_333M_COG_V2:PROBAV_S10_TOC_X18Y02_20171101_333M_V201', 'type': 'application/json'}, {'href': 'urn:eop:VITO:PROBAV_S10_TOC_333M_COG_V2:PROBAV_S10_TOC_X18Y02_20171101_333M_V201', 'rel': 'derived_from', 'title': 'Derived from urn:eop:VITO:PROBAV_S10_TOC_333M_COG_V2:PROBAV_S10_TOC_X18Y02_20171101_333M_V201', 'type': 'application/json'}, {'href': 'urn:eop:VITO:PROBAV_S10_TOC_333M_COG_V2:PROBAV_S10_TOC_X18Y02_20171101_333M_V201', 'rel': 'derived_from', 'title': 'Derived from urn:eop:VITO:PROBAV_S10_TOC_333M_COG_V2:PROBAV_S10_TOC_X18Y02_20171101_333M_V201', 'type': 'application/json'}, {'href': 'urn:eop:VITO:PROBAV_S10_TOC_333M_COG_V2:PROBAV_S10_TOC_X18Y02_20171101_333M_V201', 'rel': 'derived_from', 'title': 'Derived from urn:eop:VITO:PROBAV_S10_TOC_333M_COG_V2:PROBAV_S10_TOC_X18Y02_20171101_333M_V201', 'type': 'application/json'}, {'href': 'urn:eop:VITO:PROBAV_S10_TOC_333M_COG_V2:PROBAV_S10_TOC_X18Y02_20171101_333M_V201', 'rel': 'derived_from', 'title': 'Derived from urn:eop:VITO:PROBAV_S10_TOC_333M_COG_V2:PROBAV_S10_TOC_X18Y02_20171101_333M_V201', 'type': 'application/json'}, {'href': 'urn:eop:VITO:PROBAV_S10_TOC_333M_COG_V2:PROBAV_S10_TOC_X18Y02_20171101_333M_V201', 'rel': 'derived_from', 'title': 'Derived from urn:eop:VITO:PROBAV_S10_TOC_333M_COG_V2:PROBAV_S10_TOC_X18Y02_20171101_333M_V201', 'type': 'application/json'}, {'href': 'urn:eop:VITO:PROBAV_S10_TOC_333M_COG_V2:PROBAV_S10_TOC_X18Y02_20171101_333M_V201', 'rel': 'derived_from', 'title': 'Derived from urn:eop:VITO:PROBAV_S10_TOC_333M_COG_V2:PROBAV_S10_TOC_X18Y02_20171101_333M_V201', 'type': 'application/json'}], 'proj:bbox': [4.8257395, 51.2594548, 4.8614451, 51.3088932], 'proj:shape': [13, 36], 'assets': {'openEO.tif': {'href': '/data/projects/OpenEO/j-24011972cfb04efcb15e28d0b230a23b/openEO.tif', 'type': 'image/tiff; application=geotiff', 'roles': ['data'], 'bands': [], 'nodata': nan, 'datetime': None, 'raster:bands': [{'name': '1', 'statistics': {'minimum': 3.0, 'maximum': 5.0, 'mean': 4.2350427350427, 'stddev': 0.97198503728382, 'valid_percent': 100.0}}]}}, 'epsg': 4326, 'instruments': ['PROBA-V'], 'processing:facility': 'VITO - SPARK', 'processing:software': 'openeo-geotrellis-0.23.0a1', 'unique_process_ids': ['reduce_dimension', 'load_ml_model', 'save_result', 'load_collection', 'predict_random_forest', 'mean'], 'providers': [{'name': 'VITO', 'description': 'This data was processed on an openEO backend maintained by VITO.', 'roles': ['processor'], 'processing:facility': 'openEO Geotrellis backend', 'processing:software': {'Geotrellis backend': '0.23.0a1'}, 'processing:expression': [{'format': 'openeo', 'expression': {'loadmlmodel1': {'process_id': 'load_ml_model', 'arguments': {'id': 'j-240119d8e2234977beeb86f307291756'}}, 'loadcollection1': {'process_id': 'load_collection', 'arguments': {'bands': ['NDVI'], 'id': 'PROBAV_L3_S10_TOC_333M', 'spatial_extent': {'west': 4.825919, 'east': 4.859629, 'south': 51.259766, 'north': 51.307638}, 'temporal_extent': ['2017-11-01', '2017-11-01']}}, 'reducedimension1': {'process_id': 'reduce_dimension', 'arguments': {'data': {'from_node': 'loadcollection1'}, 'dimension': 't', 'reducer': {'process_graph': {'mean1': {'process_id': 'mean', 'arguments': {'data': {'from_parameter': 'data'}}, 'result': True}}}}}, 'reducedimension2': {'process_id': 'reduce_dimension', 'arguments': {'context': {'from_node': 'loadmlmodel1'}, 'data': {'from_node': 'reducedimension1'}, 'dimension': 'bands', 'reducer': {'process_graph': {'predictrandomforest1': {'process_id': 'predict_random_forest', 'arguments': {'data': {'from_parameter': 'data'}, 'model': {'from_parameter': 'context'}}, 'result': True}}}}}, 'saveresult1': {'process_id': 'save_result', 'arguments': {'data': {'from_node': 'reducedimension2'}, 'format': 'GTiff', 'options': {}}, 'result': True}}}]}], 'usage': {'input_pixel': {'value': 0.0625, 'unit': 'mega-pixel'}}}} Traceback (most recent call last): File "/opt/venv/lib64/python3.8/site-packages/requests/models.py", line 511, in prepare_body body = complexjson.dumps(json, allow_nan=False) File "/usr/lib64/python3.8/json/__init__.py", line 234, in dumps return cls( File "/usr/lib64/python3.8/json/encoder.py", line 199, in encode chunks = self.iterencode(o, _one_shot=True) File "/usr/lib64/python3.8/json/encoder.py", line 257, in iterencode return _iterencode(o, 0) ValueError: Out of range float values are not JSON compliant During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/opt/venv/lib64/python3.8/site-packages/openeogeotrellis/job_tracker_v2.py", line 430, in update_statuses self._sync_job_status( File "/opt/venv/lib64/python3.8/site-packages/openeogeotrellis/job_tracker_v2.py", line 553, in _sync_job_status double_job_registry.set_results_metadata(job_id, user_id, costs=job_costs, usage=dict(total_usage), File "/opt/venv/lib64/python3.8/site-packages/openeogeotrellis/job_registry.py", line 964, in set_results_metadata self.elastic_job_registry.set_results_metadata(job_id=job_id, costs=costs, usage=usage, File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/jobregistry.py", line 553, in set_results_metadata return self._update(job_id=job_id, data={ File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/jobregistry.py", line 460, in _update return self._do_request("PATCH", f"/jobs/{job_id}", json=data) File "/opt/venv/lib64/python3.8/site-packages/openeo_driver/jobregistry.py", line 297, in _do_request response = self._session.request( File "/opt/venv/lib64/python3.8/site-packages/requests/sessions.py", line 575, in request prep = self.prepare_request(req) File "/opt/venv/lib64/python3.8/site-packages/requests/sessions.py", line 486, in prepare_request p.prepare( File "/opt/venv/lib64/python3.8/site-packages/requests/models.py", line 371, in prepare self.prepare_body(data, files, json) File "/opt/venv/lib64/python3.8/site-packages/requests/models.py", line 513, in prepare_body raise InvalidJSONError(ve, request=self) requests.exceptions.InvalidJSONError: Out of range float values are not JSON compliant
- Loading branch information