Skip to content

Commit 5eb7608

Browse files
committed
Issue #115 crossbackend: switch to load_stac + partial job results
1 parent adae14a commit 5eb7608

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

src/openeo_aggregator/partitionedjobs/tracking.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,14 @@ def create_crossbackend_pjob(
102102
create_stats = collections.Counter()
103103

104104
def get_replacement(node_id: str, node: dict, subgraph_id: SubGraphId) -> dict:
105-
# TODO: use `load_stac` iso `load_result`, and use canonical URL?
106105
nonlocal batch_jobs
107-
job_id = batch_jobs[subgraph_id].job_id
106+
# TODO: use canonical URL to circumvent auth issues
107+
# but how does `parial` work there? (https://github.com/Open-EO/openeo-api/issues/507)
108+
stac_url = batch_jobs[subgraph_id].get_results_metadata_url(full=True) + "?partial=true"
108109
return {
109110
node_id: {
110-
"process_id": "load_result",
111-
"arguments": {"id": job_id},
111+
"process_id": "load_stac",
112+
"arguments": {"url": stac_url},
112113
}
113114
}
114115

tests/partitionedjobs/test_api.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,10 @@ def test_create_job_basic(self, flask_app, api100, zk_db, dummy1):
753753
"backend_id": "b1",
754754
"process_graph": {
755755
"lc1": {"process_id": "load_collection", "arguments": {"id": "S2"}},
756-
"lc2": {"process_id": "load_result", "arguments": {"id": "1-jb-0"}},
756+
"lc2": {
757+
"process_id": "load_stac",
758+
"arguments": {"url": "https://b1.test/v1/jobs/1-jb-0/results?partial=true"},
759+
},
757760
"merge": {
758761
"process_id": "merge_cubes",
759762
"arguments": {"cube1": {"from_node": "lc1"}, "cube2": {"from_node": "lc2"}},
@@ -775,7 +778,10 @@ def test_create_job_basic(self, flask_app, api100, zk_db, dummy1):
775778
assert dummy1.get_job_status(TEST_USER, expected_job_id) == "created"
776779
assert dummy1.get_job_data(TEST_USER, expected_job_id).create["process"]["process_graph"] == {
777780
"lc1": {"process_id": "load_collection", "arguments": {"id": "S2"}},
778-
"lc2": {"process_id": "load_result", "arguments": {"id": "1-jb-0"}},
781+
"lc2": {
782+
"process_id": "load_stac",
783+
"arguments": {"url": "https://b1.test/v1/jobs/1-jb-0/results?partial=true"},
784+
},
779785
"merge": {
780786
"process_id": "merge_cubes",
781787
"arguments": {"cube1": {"from_node": "lc1"}, "cube2": {"from_node": "lc2"}},

0 commit comments

Comments
 (0)