diff --git a/api/routers/edr.py b/api/routers/edr.py index 18c64eeb..00c99795 100644 --- a/api/routers/edr.py +++ b/api/routers/edr.py @@ -77,8 +77,10 @@ async def get_data_location_id( get_obs_request = dstore.GetObsRequest( filter=dict( platform=dstore.Strings(values=[location_id]), - instrument=dstore.Strings( - values=list(map(str.strip, parameter_name.split(","))) if parameter_name else "*" + **( + {"instrument": dstore.Strings(values=list(map(str.strip, parameter_name.split(","))))} + if parameter_name + else {} ), ), temporal_interval=dstore.TimeInterval(start=range[0], end=range[1]) if range else None, @@ -144,7 +146,11 @@ async def get_data_area( range = get_datetime_range(datetime) get_obs_request = dstore.GetObsRequest( filter=dict( - instrument=dstore.Strings(values=list(map(str.strip, parameter_name.split(","))) if parameter_name else "*") + **( + {"instrument": dstore.Strings(values=list(map(str.strip, parameter_name.split(","))))} + if parameter_name + else {} + ), ), spatial_area=dstore.Polygon( points=[dstore.Point(lat=coord[1], lon=coord[0]) for coord in poly.exterior.coords] diff --git a/api/test/test_edr.py b/api/test/test_edr.py index 6490213a..1d557d8f 100644 --- a/api/test/test_edr.py +++ b/api/test/test_edr.py @@ -50,7 +50,8 @@ def test_get_locations_id_without_parameter_names_query(): mock_getObsRequest.assert_called_once() m_args = mock_getObsRequest.call_args[0][0] - assert {"*"} == set(m_args.filter["instrument"].values) + assert "instrument" not in m_args.filter + assert {"06260"} == set(m_args.filter["platform"].values) assert response.status_code == 200 assert response.json() == compare_data