Skip to content

Commit

Permalink
Merge branch 'issue165-failing-tests'
Browse files Browse the repository at this point in the history
  • Loading branch information
soxofaan committed Jan 8, 2025
2 parents 7cb937b + 47e4b2b commit 1125990
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is roughly based on [Keep a Changelog](https://keepachangelog.com/en/

<!-- start-of-changelog -->

## unreleased

- Update to harmonized `job_option`/`additional` handling in `Connection.create_job` ([#165](https://github.com/Open-EO/openeo-aggregator/issues/165), [Open-EO/openeo-python-client#683](https://github.com/Open-EO/openeo-python-client/issues/683))

## 0.39.0

- More advanced process-graph splitting for cross-backend execution: not limited to splitting off `load_collection` nodes, but cut deeper into the graph. ([#150](https://github.com/Open-EO/openeo-aggregator/issues/150))
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
install_requires=[
"requests",
"attrs",
"openeo>=0.27.0",
"openeo_driver>=0.107.4.dev",
"openeo>=0.36.0",
"openeo_driver>=0.123.0.dev",
"flask~=2.0",
"gunicorn~=20.0",
"python-json-logger>=2.0.0",
Expand Down
8 changes: 3 additions & 5 deletions src/openeo_aggregator/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -866,13 +866,11 @@ def _create_job_standard(
process_graph = self.processing.preprocess_process_graph(process_graph, backend_id=backend_id)

if job_options:
additional = {k: v for k, v in job_options.items() if not k.startswith("_agg_")}
else:
additional = None
job_options = {k: v for k, v in job_options.items() if not k.startswith("_agg_")}

if get_backend_config().job_options_update:
# Allow fine-tuning job options through config
additional = get_backend_config().job_options_update(job_options=additional, backend_id=backend_id)
job_options = get_backend_config().job_options_update(job_options=job_options, backend_id=backend_id)

con = self.backends.get_connection(backend_id)
with con.authenticated_from_request(request=flask.request, user=User(user_id=user_id)), con.override(
Expand All @@ -885,7 +883,7 @@ def _create_job_standard(
description=metadata.get("description"),
plan=metadata.get("plan"),
budget=metadata.get("budget"),
additional=additional,
job_options=job_options,
)
except OpenEoApiError as e:
for exc_class in [ProcessGraphMissingException, ProcessGraphInvalidException]:
Expand Down
6 changes: 4 additions & 2 deletions tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,7 @@ def test_processes_basic(self, api100, requests_mock, backend1, backend2):
},
],
"links": [],
"version": None,
}

@pytest.mark.parametrize(
Expand Down Expand Up @@ -844,7 +845,7 @@ def test_processes_resilience(
else:
requests_mock.get(backend2 + "/processes", status_code=404, text="nope")
res = api100.get("/processes").assert_status_code(200).json
assert res == {"processes": expected, "links": []}
assert res == {"processes": expected, "links": [], "version": None}

def test_result_basic_math_basic_auth(self, api100, requests_mock, backend1, backend2):
def post_result(request: requests.Request, context):
Expand Down Expand Up @@ -1006,6 +1007,7 @@ def test_processes_different_versions(self, api100, requests_mock, backend1, bac
DictSubSet({"id": "prod", "federation:backends": ["b2"]}),
],
"links": [],
"version": None,
}

def test_result_backend_by_collection_multiple_hits(self, api100, requests_mock, backend1, backend2, caplog):
Expand Down Expand Up @@ -1953,7 +1955,7 @@ def post_jobs(request: requests.Request, context):
).assert_status_code(201)
assert res.headers["Location"] == f"http://oeoa.test/openeo/1.0.0/jobs/{expected}-th3j0b"
assert res.headers["OpenEO-Identifier"] == f"{expected}-th3j0b"
assert jobs == [{"process": {"process_graph": pg}}]
assert jobs == [{"process": {"process_graph": pg}, "job_options": {}}]

assert (backend1_post_jobs.call_count, backend2_post_jobs.call_count) == {
"b1": (1, 0),
Expand Down

0 comments on commit 1125990

Please sign in to comment.