Open-EO / Open-EO/openeo-python-client

Avoid setting default values for process arguments

Open
#500 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api compliancy architecture documentation usability
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_spatial example 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.