-
Notifications
You must be signed in to change notification settings - Fork 427
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
Setting <UnicodeSetAttribute>.set([]) (empty list) throws "Nonetype is not iterable" error. #962
Comments
@ikonst reopening as I ran into this again, is it a bug? Feels very annoying to not be able to reset a UnicodeSetAttribute to empty in an update operation.
|
I wonder what causes this error. For what it's worth, though, underlying dynamodb does not support empty sets:
|
I guess the annoying part is by removing it, you have to ensure any uses of the value explicitly test for |
I agree. Since the underlying database cannot store an empty set for us, we have to pick an alternative representation. An attribute being unset in the DynamoDB item manifests as We could decide on a rule e.g. an empty set serializes as Another compromise would be:
|
Fixes #962. Allows update expressions to assign empty values to set-typed attributes by converting those SETs to REMOVEs.
@ikonst thank you! |
Ran into this. Thanks for the fix! |
During an update operation a UnicodeSet field may have it's value changed back to empty e.g. []
The following code fails:
*** TypeError: 'NoneType' object is not iterable
The following two examples work:
Is this a bug?
The text was updated successfully, but these errors were encountered: