You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In jsonnet 0.22.0, Python native callbacks registered with two or more parameters fail at runtime if all parameter names have a length of 2 or more characters. The error is:
RUNTIME ERROR: binding parameter a second time: <param_name>
This appears to be a regression introduced in 0.22.0 (likely related to PR #1299 which changed built-in function argument binding).
Environment
jsonnet version: 0.22.0
Python version: 3.13.13 (also reproduced on 3.10+)
OS: Linux
Minimal Reproduction
import_jsonnetdefmy_func(a, b):
return"{} {}".format(a, b)
# This FAILS in 0.22.0 (worked in 0.21.0)result=_jsonnet.evaluate_snippet(
"test",
'std.native("my_func")("a", "b")',
native_callbacks={"my_func": (("target", "path"), my_func)}
)
Error:
RuntimeError: RUNTIME ERROR: binding parameter a second time: path
Observations
Single-parameter callbacks work fine regardless of name length.
At least one parameter must be 1 character long for multi-param callbacks to work:
# WORKS (one 1-char param)
(("t", "path"), my_func)
The issue affects all multi-param native callbacks, not just specific names.
Summary
In jsonnet 0.22.0, Python native callbacks registered with two or more parameters fail at runtime if all parameter names have a length of 2 or more characters. The error is:
This appears to be a regression introduced in 0.22.0 (likely related to PR #1299 which changed built-in function argument binding).
Environment
Minimal Reproduction
Error:
Observations
Expected Behavior
Native callbacks with multi-character parameter names should work as they did in 0.21.0.
Actual Behavior
Runtime error when evaluating any native callback where all parameter names are ≥2 characters.
Regression Range
Related