Skip to content

Commit c7ccb26

Browse files
committed
Issue #165 update to new job_option handling in connection.create_job
1 parent 7cb937b commit c7ccb26

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is roughly based on [Keep a Changelog](https://keepachangelog.com/en/
66

77
<!-- start-of-changelog -->
88

9+
## unreleased
10+
11+
- 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))
12+
913
## 0.39.0
1014

1115
- 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))

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
install_requires=[
3535
"requests",
3636
"attrs",
37-
"openeo>=0.27.0",
37+
"openeo>=0.36.0",
3838
"openeo_driver>=0.107.4.dev",
3939
"flask~=2.0",
4040
"gunicorn~=20.0",

src/openeo_aggregator/backend.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -866,13 +866,11 @@ def _create_job_standard(
866866
process_graph = self.processing.preprocess_process_graph(process_graph, backend_id=backend_id)
867867

868868
if job_options:
869-
additional = {k: v for k, v in job_options.items() if not k.startswith("_agg_")}
870-
else:
871-
additional = None
869+
job_options = {k: v for k, v in job_options.items() if not k.startswith("_agg_")}
872870

873871
if get_backend_config().job_options_update:
874872
# Allow fine-tuning job options through config
875-
additional = get_backend_config().job_options_update(job_options=additional, backend_id=backend_id)
873+
job_options = get_backend_config().job_options_update(job_options=job_options, backend_id=backend_id)
876874

877875
con = self.backends.get_connection(backend_id)
878876
with con.authenticated_from_request(request=flask.request, user=User(user_id=user_id)), con.override(
@@ -885,7 +883,7 @@ def _create_job_standard(
885883
description=metadata.get("description"),
886884
plan=metadata.get("plan"),
887885
budget=metadata.get("budget"),
888-
additional=additional,
886+
job_options=job_options,
889887
)
890888
except OpenEoApiError as e:
891889
for exc_class in [ProcessGraphMissingException, ProcessGraphInvalidException]:

tests/test_views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1953,7 +1953,7 @@ def post_jobs(request: requests.Request, context):
19531953
).assert_status_code(201)
19541954
assert res.headers["Location"] == f"http://oeoa.test/openeo/1.0.0/jobs/{expected}-th3j0b"
19551955
assert res.headers["OpenEO-Identifier"] == f"{expected}-th3j0b"
1956-
assert jobs == [{"process": {"process_graph": pg}}]
1956+
assert jobs == [{"process": {"process_graph": pg}, "job_options": {}}]
19571957

19581958
assert (backend1_post_jobs.call_count, backend2_post_jobs.call_count) == {
19591959
"b1": (1, 0),

0 commit comments

Comments
 (0)