Skip to content

Fix identity callbacks in process graphs - #978

Open
Duo-ee wants to merge 3 commits into
Open-EO:masterfrom
Duo-ee:codex/support-identity-callbacks
Open

Duo-ee wants to merge 3 commits into
Open-EO:masterfrom
Duo-ee:codex/support-identity-callbacks

Conversation

@Duo-ee

@Duo-ee Duo-ee commented Nov 18, 2026

Copy link
Copy Markdown

Fixes #569.

A callback that returns its input, such as cube.apply(lambda x: x), now wraps that input in a standard constant result node. This keeps the original parameter reference and gives the callback graph a valid result.

Four regression cases cover direct inputs, remapped parameters, bundled inputs, and DataCube.apply. The builder and DataCube suites passed with 410 tests and 2 skips. Pre-commit passed on the changed files.

Codex authored the patch, regression tests, and this description.

[
(None, {"from_parameter": "x"}),
(["data"], {"from_parameter": "data"}),
(["x", "y"], [{"from_parameter": "x"}, {"from_parameter": "y"}]),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this x,y use case makes little sense. The callable is just lambda x:x. Does this test actually pass?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the original case passes: the x/y adapter packs both parent parameters into a list when the callable takes one argument, so lambda x: x returns the whole list. That made it a confusing example. In 1dc23aa I replaced it with a merge_cubes test using lambda x, y: y to keep the right-hand pixel in the overlap. It checks that the resolver graph references only y. The unary apply regression for #569 is still covered.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support "identity" callbacks

2 participants