From cb70a7dbfe2b0afc3201b8ffab6f8b9d239c5599 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..51a11b2 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 + yield 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()