Skip to content

Commit 1d09fbd

Browse files
authored
clarify udf signature annotations (#757 #907)
1 parent b34d32c commit 1d09fbd

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2020

2121
### Fixed
2222

23+
- Clarify UDF documentation on required function type annotations. ([#757](https://github.com/Open-EO/openeo-python-client/issues/757))
2324

2425
## [0.51.0] - 2026-07-16
2526

‎docs/udf.rst‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,26 @@ as defined in the :py:mod:`openeo.udf.udf_signatures` module,
152152
so that the back-end knows what the *entrypoint* function is
153153
of your UDF implementation.
154154

155+
The function name and Python type annotations are part of that signature:
156+
they are used to detect how the UDF should be invoked.
157+
Do not omit the type annotations on the UDF entrypoint, even if your editor
158+
or linter would otherwise consider them optional.
159+
For example, this is not enough:
160+
161+
.. code-block:: python
162+
163+
def apply_datacube(cube, context):
164+
...
165+
166+
Instead, write the full annotated signature:
167+
168+
.. code-block:: python
169+
170+
import xarray
171+
172+
def apply_datacube(cube: xarray.DataArray, context: dict) -> xarray.DataArray:
173+
...
174+
155175
156176
Module ``openeo.udf.udf_signatures``
157177
-------------------------------------

0 commit comments

Comments
 (0)