-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
When an openEO process has an argument of type integer and a value for this argument is provided as an integer, this value is passed as a float.
Version: 2025.10.1
Below is an example. The assertion in the impl method fails, as parameter x is passed as a float, not as an integer.
from openeo_pg_parser_networkx import ProcessRegistry, Process, OpenEOProcessGraph
# Step 1)
# Define a process with an integer input
spec = {
"id": "test_process",
"summary": "foo",
"description": "bar",
"categories": [],
"experimental": True,
"parameters": [
{
"name": "x",
"description": "test",
"schema": {
"type": "integer",
}
}
],
"returns": {
"description": "The same int",
"schema": {
"type": "integer"
}
}
}
def impl(x, *args, **kwargs):
assert isinstance(x, int) # THIS ASSERTION FAILS
return x
# Step 2:
# Add process to registry
registry = ProcessRegistry()
registry["test_process"] = Process(spec, impl)
# Step 3:
# Make a process graph that uses this process and call it
process_graph = {
"process_graph": {
"test": {
"process_id": "test_process",
"arguments": {
"x": 1
},
"result": True,
},
},
"parameters": [],
}
parsed_graph = OpenEOProcessGraph(process_graph)
pg_callable = parsed_graph.to_callable(process_registry=registry)
out = pg_callable()Metadata
Metadata
Assignees
Labels
No labels