Skip to content
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

Support empty values for non-key String and Binary attributes #145

Open
numberoverzero opened this issue May 28, 2020 · 0 comments
Open

Comments

@numberoverzero
Copy link
Owner

Announcement here and PutItem reference here

Empty String and Binary attribute values are allowed. Attribute values of type String and Binary must have a length greater than zero if the attribute is used as a key attribute for a table or index.

This may be a breaking change if "" changes from meaning "no value please ensure deletion during update" to "put an empty value". From Type._dump and String.dynamo_dump it appears that "" gets transformed to None before _dump and then returns actions.wrap(None) (implemented here) which returns NONE_SENTINEL (defined here as a remove action).

There's a question about where key vs non-key constraints are handled. Since load/dump take a context object we could push is_key=True into the context and let the load/dump function sort out validity, or keep it simple and let the caller inspect the returned value and throw exceptions.

Finally, there's probably some complexity around DynamicType and StringSet/BinarySet that need to be figured out.

Some links to provide context around current design decisions and where changes are anticipated:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant