-
Notifications
You must be signed in to change notification settings - Fork 39
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
Can't serialize with a None value #434
Comments
Do you mind posting the definition of |
https://github.com/craigerl/aprsd/blob/master/aprsd/packets/core.py#L292-L311 The parent class is here: I'm testing serde to see if I can use it instead of manually calling the json attribute. Here is my test script. It requires installing aprsd. You can just create a venv and install aprsd that way from either pip or github url here:
I added some debug output to serde's se.py to
|
After further hacking on serde, I was able to modify the to_dict() template generation to print out the assignments inside of the generated function. as well as what the result of the generated function itself was.
and the result is
It looks like it can't handle the datetime field as defined here: |
So it looks like there are a few problems here:
or using the default_factory
|
This seems really basic, but I have dataclass instance with a property that has a None value, which is totally legit.
Trying to convert to json fails with
The text was updated successfully, but these errors were encountered: