Open-EO / Open-EO/openeo-python-client
Avoid setting default values for process arguments
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 217
- Forks
- 56
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 2
Description
from https://github.com/Open-EO/openeo-processes-dask/pull/103#issuecomment-1803587719
In case of resample_spatial however, we do always add the align parameter with default value "upper-left"
I think this should be changed. It should only be sent if not the default value and supported by the back-end.
A lot of DataCube methods adapted the default argument values from openeo-processes specs.
For example cube.resample_spatial() (without explicit align arg) will silently set align="upper-left" in the resulting process graph.
This has some subtle effects:
- if a back-end chooses a different default value than the "official" specs, this will not be picked up automatically unless the user manages to unset the argument in the process graph in some way (which in the
resample_spatialexample above would be pretty ugly to do) - if a backend chooses not to support an argument, it will still receive it from the python client, which might break back-end side validation. Again, it is pretty ugly to workaround this.
So, it should be a general rule on DataCube methods to only adapt explicitly specified method arguments as process arguments in the process graph.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the DataCube methods that adapt openeo-processes defaults, using resample_spatial() and its align argument as the concrete example. Check how method arguments become process-graph arguments and identify existing tests around this behavior. Done means omitted method arguments are not emitted with spec defaults, while explicitly provided arguments continue to be handled correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100