A code-declared node's shim names only its triggering ports, so a non-triggering input with no value yet reaches the function as its own default instead of failing the call
This commit is contained in:
@@ -877,12 +877,16 @@ def _shim(spec: NodeSpec) -> str:
|
||||
The import is aliased because ``process``'s parameters are the node's port
|
||||
names, and a port may be named after the very function it feeds — which
|
||||
would otherwise shadow the import inside the body.
|
||||
|
||||
Only the triggering ports are named. The engine leaves out an input that
|
||||
has no value yet, which only a port that does not trigger can lack, so
|
||||
those travel in ``**settings`` and the function's own default applies.
|
||||
"""
|
||||
_refuse_main(spec)
|
||||
fn = spec.fn
|
||||
where = inspect.getsourcefile(fn) or fn.__module__
|
||||
repo = import_root(fn)
|
||||
ports = [port.port for port in spec.requires]
|
||||
ports = [port.port for port in spec.requires if port.trigger]
|
||||
signature = ", ".join(ports + ["**settings"])
|
||||
arguments = ", ".join([f"{port}={port}" for port in ports] + ["**settings"])
|
||||
call = f"_impl({arguments})"
|
||||
|
||||
Reference in New Issue
Block a user