-
-
Notifications
You must be signed in to change notification settings - Fork 62
Closed
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Description
To reproduce
from pydantic import BaseModel
from jsonargparse import auto_cli
class ModelBase(BaseModel): ...
class Model(ModelBase):
name: str = "default"
class Experiment(ModelBase):
model: ModelBase
exp = Experiment(model=Model())
def run(x:Experiment = exp):
print(x)
if __name__ == "__main__":
auto_cli(run)
...
File ".venv/lib/python3.12/site-packages/jsonargparse/_core.py", line 208, in set_defaults
raise NSKeyError(f'No action for key "{dest}" to set its default.')
jsonargparse._namespace.NSKeyError: No action for key "x.model" to set its default.
I'm not very sure whether it relates to previous discussions on dataclass and subclasses. All I can see after debugging is that an ArgumentGroup is created for x.model but there's not actions added to the _actions field.
Environment
- jsonargparse version:
4.41.0
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request