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

DataCube.save_result returns DataCube instead of (wrapped) true #402

Open
soxofaan opened this issue Mar 24, 2023 · 5 comments
Open

DataCube.save_result returns DataCube instead of (wrapped) true #402

soxofaan opened this issue Mar 24, 2023 · 5 comments

Comments

@soxofaan
Copy link
Member

related to #401, Open-EO/openeo-processes#334, Open-EO/openeo-processes#401

DataCube.save_result returns a DataCube, while it technically should return true (wrapped in _ProcessGraphAbstraction, to allow calling .download(), .create_job, ...)

@clausmichele
Copy link
Member

@soxofaan as far as I understand, the return value of save_result mentioned is what the process should return when executed in the back-end, and not something that the client should take care of. @m-mohr do I understand it correctly?

@soxofaan
Copy link
Member Author

This ticket is purely about the python client side:
The Python method DataCube.save_result currently returns a (new) DataCube instance, which allow the user to call things like aggregate_spatial or reduce_dimension on that:

cube = con.load_collection(...)
result = cube.save_result(...)
result = result.reduce_dimension(...)

which makes no sense (because the output of the save_result openEO process is a boolean), so the client should not allow that.

Instead, the DataCube.save_result should return something that still supports .download(), .execute_batch() and alike, but not allow all the data processing methods like aggregate_spatial, ...

@clausmichele
Copy link
Member

Ok now I get it!

@soxofaan
Copy link
Member Author

having a dedicated "save_result" object will also simplify the save_result related checks and format guessing hacks from #401/#449

@m-mohr
Copy link
Member

m-mohr commented Sep 4, 2024

Note that it's planned that save_result changes from boolean return value to a STAC type:

Open-EO/openeo-processes#485

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

No branches or pull requests

3 participants