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
importjsonargparse# Here define one or more functions or classesdeffunc1(param1: str="{{something}}"):
...
# Run the CLI providing the componentsjsonargparse.CLI([func1], error_handler=None)
Invoking this fails with a long traceback that looks like something related to encoding the default value as yaml?
raise ConstructorError("while constructing a mapping", node.start_mark,
yaml.constructor.ConstructorError: while constructing a mapping
in "<unicode string>", line 1, column 1
found unhashable key
in "<unicode string>", line 1, column 2
My guess is because if this is a value in yaml it looks like you're trying to build a dict with a dict as a key. Is there a workaround for this? My use case is I want to pass in jinja template-like things.
Expected behavior
The CLI would run without error.
Environment
jsonargparse version (e.g., 4.8.0): 4.16.0
Python version (e.g., 3.9): 3.10
How jsonargparse was installed (e.g. pip install jsonargparse[all]): pip install jsonargparse
OS (e.g., Linux): MacOS
The text was updated successfully, but these errors were encountered:
🐛 Bug report
Default values can't look like
{{something}}
To reproduce
Invoking this fails with a long traceback that looks like something related to encoding the default value as yaml?
My guess is because if this is a value in yaml it looks like you're trying to build a dict with a dict as a key. Is there a workaround for this? My use case is I want to pass in jinja template-like things.
Expected behavior
The CLI would run without error.
Environment
pip install jsonargparse[all]
): pip install jsonargparseThe text was updated successfully, but these errors were encountered: