Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

duplicate save_results after datacube_from_flat_graph #732

Closed
soxofaan opened this issue Feb 17, 2025 · 2 comments
Closed

duplicate save_results after datacube_from_flat_graph #732

soxofaan opened this issue Feb 17, 2025 · 2 comments
Assignees
Labels

Comments

@soxofaan
Copy link
Member

soxofaan commented Feb 17, 2025

when loading a process graph with a save_result node through datacube_from_flat_graph, you get a DataCube object, instead of the new SaveResult object.
If you execute_batch this, you get an additional save_result

related to #720 #402 #725

@soxofaan soxofaan added the bug label Feb 17, 2025
@soxofaan
Copy link
Member Author

e.g.

import openeo
from unittest import mock

connection = openeo.connect("openeo.vito.be")

pg = {
    "lc": {"process_id": "load_collection", "arguments": {}},
    "sr": {
        "process_id": "save_result", 
        "arguments": {"data": {"from_node": "lc"}},
        "result": True,
    },
}

cube = connection.datacube_from_flat_graph(pg)

with mock.patch(
    "openeo.rest.connection.Connection.create_job", 
    new=lambda *args, **kwargs: print((args, kwargs))
):
    cube.create_job()

((<Connection to 'https://openeo.vito.be/openeo/1.2/' with NullAuth>,), {'process_graph': {'loadcollection1': {'process_id': 'load_collection', 'arguments': {}}, 'saveresult1': {'process_id': 'save_result', 'arguments': {'data': {'from_node': 'loadcollection1'}}}, 'saveresult2': {'process_id': 'save_result', 'arguments': {'data': {'from_node': 'saveresult1'}, 'format': 'GTiff', 'options': {}}, 'result': True}}, 'title': None, 'description': None, 'plan': None, 'budget': None, 'validate': None, 'additional': None, 'job_options': None, 'log_level': None})

@soxofaan soxofaan self-assigned this Feb 17, 2025
soxofaan added a commit that referenced this issue Feb 17, 2025
@soxofaan
Copy link
Member Author

quickfixed bug with 9b1e6a4

remaining work is for #733

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant