-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
to_dict and from_dict do not support None as value for an Optional nested in Tuple #73
Comments
It seems like |
@Fatal1ty May I ask, is this related problem? Can't get Optional working as I would expect. In my yaml file there is nothing like setup2, but I'd expect, since it is Optional, it will be silently ignored.
code
|
@peku-jamf type See docs: https://docs.python.org/3/library/typing.html#typing.Optional |
Thank you @Fatal1ty |
@Mindstan Sorry for such a long delay, I was on vacation and tried to distract myself from the Internet. I have fixed this issue and released 3.0.1 version. You can give it a try! |
Thanks, it works now in our project. |
Description
I'm trying to set an optional value in a
Tuple
(in the exampleTuple[Optional[int], int]
) and export it in YAML, but it results in aTypeError
. By looking at the generated code (see below), we can see theOptional
is ignored by the builder.What I Did
Output:
Generated code for
to_dict
:EDIT:
from_dict
also suffers from the same issueThe text was updated successfully, but these errors were encountered: