From 518e22023991bc9cfd2f435acf0cb007a6bf607d Mon Sep 17 00:00:00 2001 From: Devin Cowan Date: Wed, 11 Oct 2023 16:03:49 -0400 Subject: [PATCH] disable spatial coverage query --- hsclient/hydroshare.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/hsclient/hydroshare.py b/hsclient/hydroshare.py index 15335b6..aea33bf 100644 --- a/hsclient/hydroshare.py +++ b/hsclient/hydroshare.py @@ -1446,15 +1446,19 @@ def search( if to_date: params["to_date"] = to_date.strftime('%Y-%m-%d') if spatial_coverage: - params["coverage_type"] = spatial_coverage.type - if spatial_coverage.type == "point": - params["north"] = spatial_coverage.north - params["east"] = spatial_coverage.east - else: - params["north"] = spatial_coverage.northlimit - params["east"] = spatial_coverage.eastlimit - params["south"] = spatial_coverage.southlimit - params["west"] = spatial_coverage.westlimit + raise Exception( + "Bad Request, status_code 400, spatial_coverage queries are disabled." + ) + # TODO: re-enable after resolution of https://github.com/hydroshare/hydroshare/issues/5240 + # params["coverage_type"] = spatial_coverage.type + # if spatial_coverage.type == "point": + # params["north"] = spatial_coverage.north + # params["east"] = spatial_coverage.east + # else: + # params["north"] = spatial_coverage.northlimit + # params["east"] = spatial_coverage.eastlimit + # params["south"] = spatial_coverage.southlimit + # params["west"] = spatial_coverage.westlimit response = self._hs_session.get("/hsapi/resource/", 200, params=params) res = response.json()