pynamodb-attributes
pynamodb-attributes copied to clipboard
[wip] handle union/optional fields in a tuple
when you have a tuple where a type of the field is Optional[*] it becomes a Union type and breaks when trying to deserialize None to whatever value it expects.
Adding a check that if it's explicitly a union type, attempt to use all the args, whichever works first to allow that through, if a type error arises, just ignore it.
problems right now:
- if it's a union of type [
str,int] and the value is something like42, the first arg type would succeed -- taking suggestions on other ways to handle this if any. - nested unions don't work