openeo-python-client icon indicating copy to clipboard operation
openeo-python-client copied to clipboard

Avoid setting default values for process arguments

Open soxofaan opened this issue 1 year ago • 3 comments

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.

soxofaan avatar Nov 09 '23 11:11 soxofaan