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
Apologies if I'm overlooking something in the docs, but I can't figure out how to get simple_parsing to parse a dict option. No matter how I pass a dict value, I get an error saying invalid dict value.
To Reproduce
fromdataclassesimportdataclassfromsimple_parsingimportArgumentParser@dataclassclassConfig:
options: dict|None=Noneparser=ArgumentParser()
parser.add_arguments(Config, dest="config")
# fails with errorparser.parse_args(["--options", '{"x": 2}']).config# also fails with errorparser.parse_args(["--options", "x=2"]).config
Expected behavior
It should return a dataclass with {"x": 2} or {"x": "2"} as option values
Actual behavior
invalid dict value error
Desktop (please complete the following information):
Describe the bug
Apologies if I'm overlooking something in the docs, but I can't figure out how to get simple_parsing to parse a
dict
option. No matter how I pass a dict value, I get an error sayinginvalid dict value
.To Reproduce
Expected behavior
It should return a dataclass with
{"x": 2}
or{"x": "2"}
as option valuesActual behavior
invalid dict value error
Desktop (please complete the following information):
Additional context
A reproduction of this is in colab here: https://colab.research.google.com/drive/1LcDSctd9mbi5U-yz2kjuJJHI-n00RQDR#scrollTo=Ubd2JP002p6C
The text was updated successfully, but these errors were encountered: