diff --git a/CHANGELOG.md b/CHANGELOG.md index 72647715..3a908d3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format is roughly based on [Keep a Changelog](https://keepachangelog.com/en/ Keep union of all "upstream" collections as default. ([#129](https://github.com/Open-EO/openeo-aggregator/issues/129)) - Disable `auto_validation` feature of latest `openeo` python client library release ([#130](https://github.com/Open-EO/openeo-aggregator/issues/130)) +- Fix compatibility with `openeo>=0.25.0` ## [0.11.x] diff --git a/setup.py b/setup.py index b7136d7f..ac0c0272 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ install_requires=[ "requests", "attrs", - "openeo>=0.24.0", + "openeo>=0.25.0", "openeo_driver>=0.68.1.dev", "flask~=2.0", "gunicorn~=20.0", diff --git a/src/openeo_aggregator/about.py b/src/openeo_aggregator/about.py index f281616f..ac4bfd8e 100644 --- a/src/openeo_aggregator/about.py +++ b/src/openeo_aggregator/about.py @@ -2,7 +2,7 @@ import sys from typing import Optional -__version__ = "0.12.2a1" +__version__ = "0.12.3a1" def log_version_info(logger: Optional[logging.Logger] = None): diff --git a/src/openeo_aggregator/backend.py b/src/openeo_aggregator/backend.py index 7bde3177..1c0d3fba 100644 --- a/src/openeo_aggregator/backend.py +++ b/src/openeo_aggregator/backend.py @@ -24,7 +24,12 @@ import openeo import openeo_driver.util.view_helpers from openeo.capabilities import ComparableVersion -from openeo.rest import OpenEoApiError, OpenEoClientException, OpenEoRestError +from openeo.rest import ( + OpenEoApiError, + OpenEoApiPlainError, + OpenEoClientException, + OpenEoRestError, +) from openeo.util import TimingLogger, deep_get, dict_no_none from openeo_driver.backend import ( AbstractCollectionCatalog, @@ -1109,7 +1114,7 @@ def service_info(self, user_id: str, service_id: str) -> ServiceMetadata: with con.authenticated_from_request(request=flask.request, user=User(user_id)): try: service_json = con.get(f"/services/{backend_service_id}").json() - except (OpenEoApiError) as e: + except OpenEoApiPlainError as e: if e.http_status_code == 404: # Expected error _log.debug(f"No service with ID={service_id!r} in backend with ID={con.id!r}: {e!r}", exc_info=True) @@ -1159,7 +1164,7 @@ def remove_service(self, user_id: str, service_id: str) -> None: with con.authenticated_from_request(request=flask.request, user=User(user_id)): try: con.delete(f"/services/{backend_service_id}", expected_status=204) - except (OpenEoApiError) as e: + except OpenEoApiPlainError as e: if e.http_status_code == 404: # Expected error _log.debug(f"No service with ID={service_id!r} in backend with ID={con.id!r}: {e!r}", exc_info=True) @@ -1182,7 +1187,7 @@ def update_service(self, user_id: str, service_id: str, process_graph: dict) -> try: json = {"process": {"process_graph": process_graph}} con.patch(f"/services/{backend_service_id}", json=json, expected_status=204) - except (OpenEoApiError) as e: + except OpenEoApiPlainError as e: if e.http_status_code == 404: # Expected error _log.debug(f"No service with ID={backend_service_id!r} in backend with ID={con.id!r}: {e!r}", exc_info=True) diff --git a/tests/test_backend.py b/tests/test_backend.py index 1f47b4d2..bb703189 100644 --- a/tests/test_backend.py +++ b/tests/test_backend.py @@ -2,7 +2,7 @@ import logging import pytest -from openeo.rest import OpenEoApiError, OpenEoRestError +from openeo.rest import OpenEoApiError, OpenEoApiPlainError, OpenEoRestError from openeo_driver.backend import ServiceMetadata from openeo_driver.errors import ( CollectionNotFoundException, @@ -815,7 +815,7 @@ def test_remove_service_backend_response_is_an_error_status( implementation = AggregatorSecondaryServices(backends=multi_backend_connection, processing=processing, config=config) with flask_app.test_request_context(headers=TEST_USER_AUTH_HEADER): - with pytest.raises(OpenEoApiError) as e: + with pytest.raises(OpenEoApiPlainError) as e: implementation.remove_service(user_id=TEST_USER, service_id="b1-wmts-foo") # If the backend reports HTTP 400/500, we would expect the same status code from the aggregator. @@ -895,7 +895,7 @@ def test_update_service_backend_response_is_an_error_status( new_process_graph = {"bar": {"process_id": "bar", "arguments": {"arg1": "bar"}}} with flask_app.test_request_context(headers=TEST_USER_AUTH_HEADER): - with pytest.raises(OpenEoApiError) as e: + with pytest.raises(OpenEoApiPlainError) as e: implementation.update_service(user_id=TEST_USER, service_id="b1-wmts-foo", process_graph=new_process_graph) assert e.value.http_status_code == 500