diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a3259df..72647715 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is roughly based on [Keep a Changelog](https://keepachangelog.com/en/ - Add (optional) config for collection id whitelisting. 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)) ## [0.11.x] diff --git a/setup.py b/setup.py index f5bf785a..b7136d7f 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ install_requires=[ "requests", "attrs", - "openeo>=0.17.0,<0.24.0", + "openeo>=0.24.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 876e47e4..b0b90ae5 100644 --- a/src/openeo_aggregator/about.py +++ b/src/openeo_aggregator/about.py @@ -1,7 +1,7 @@ import logging import sys -__version__ = "0.12.1a1" +__version__ = "0.12.2a1" def log_version_info(): diff --git a/src/openeo_aggregator/connection.py b/src/openeo_aggregator/connection.py index 571a1ea6..b9001f8b 100644 --- a/src/openeo_aggregator/connection.py +++ b/src/openeo_aggregator/connection.py @@ -81,7 +81,9 @@ def __init__( ): # Temporarily unlock `_auth` for `super().__init__()` self._auth_locked = False - super(BackendConnection, self).__init__(url, default_timeout=init_timeout, slow_response_threshold=1) + super(BackendConnection, self).__init__( + url, default_timeout=init_timeout, slow_response_threshold=1, auto_validate=False + ) self._auth = None self._auth_locked = True diff --git a/src/openeo_aggregator/testing.py b/src/openeo_aggregator/testing.py index d0ba9c3f..db134123 100644 --- a/src/openeo_aggregator/testing.py +++ b/src/openeo_aggregator/testing.py @@ -207,6 +207,7 @@ def capabilities( {"path": "/collections", "methods": ["GET"]}, {"path": "/collections/{collection_id}", "methods": ["GET"]}, {"path": "/processes", "methods": ["GET"]}, + {"path": "/validation", "methods": ["POST"]}, ], "links": [], } diff --git a/tests/test_views.py b/tests/test_views.py index dab7cce7..e16ac8a1 100644 --- a/tests/test_views.py +++ b/tests/test_views.py @@ -1521,6 +1521,32 @@ def post_jobs(request: requests.Request, context): "b2": (0, 1), }[expected] + def test_create_job_no_auto_validation(self, api100, requests_mock, backend1, caplog): + requests_mock.get(backend1 + "/collections", json={"collections": [{"id": "S2"}]}) + + jobs = [] + + def post_jobs(request: requests.Request, context): + nonlocal jobs + jobs.append(request.json()) + context.headers["Location"] = backend1 + "/jobs/th3j0b" + context.headers["OpenEO-Identifier"] = "th3j0b" + context.status_code = 201 + + requests_mock.post(backend1 + "/jobs", text=post_jobs) + validation_mock = requests_mock.post( + backend1 + "/validation", status_code=500, json={"code": "Internal", "message": "Validation says no"} + ) + + pg = {"lc": {"process_id": "load_collection", "arguments": {"id": "S2"}, "result": True}} + api100.set_auth_bearer_token(token=TEST_USER_BEARER_TOKEN) + res = api100.post("/jobs", json={"process": {"process_graph": pg}}).assert_status_code(201) + assert res.headers["Location"] == "http://oeoa.test/openeo/1.0.0/jobs/b1-th3j0b" + assert res.headers["OpenEO-Identifier"] == "b1-th3j0b" + assert jobs == [{"process": {"process_graph": pg}}] + assert "Validation says no" not in caplog.text + assert validation_mock.call_count == 0 + def test_get_job_metadata(self, api100, requests_mock, backend1): requests_mock.get(backend1 + "/jobs/th3j0b", json={ "id": "th3j0b",