diff --git a/cubedash/_stac.py b/cubedash/_stac.py index 4b8e6d248..b33287d79 100644 --- a/cubedash/_stac.py +++ b/cubedash/_stac.py @@ -579,6 +579,13 @@ def _handle_search_request( "Only 'id', 'collection', and Item properties can be used to sort results.", ) + # Make sure users know that the query extension isn't implemented + if request_args.get("query") is not None: + abort( + 400, + "The Query extension is no longer supported. Please use the Filter extension instead.", + ) + filter_lang = request_args.get("filter-lang", default=None, type=str) filter_cql = request_args.get("filter", default=None, type=_filter_arg) filter_crs = request_args.get("filter-crs", default=None) diff --git a/integration_tests/test_stac.py b/integration_tests/test_stac.py index 26a7272eb..ec23a2afa 100644 --- a/integration_tests/test_stac.py +++ b/integration_tests/test_stac.py @@ -1544,3 +1544,22 @@ def test_stac_filter_extension(stac_client: FlaskClient): headers={"Content-Type": "application/json", "Accept": "application/json"}, ) assert rv.status_code == 400 + + +def test_stac_query_extension_errors(stac_client: FlaskClient): + # Trying to use query extension should error + query = {"cloud_cover": {"lt": 1}} + rv: Response = stac_client.post( + "/stac/search", + data=json.dumps( + { + "product": "ga_ls8c_ard_3", + "time": "2022-01-01T00:00:00/2022-12-31T00:00:00", + "limit": OUR_DATASET_LIMIT, + "_full": True, + "query": query, + } + ), + headers={"Content-Type": "application/json", "Accept": "application/json"}, + ) + assert rv.status_code == 400