You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Key and index lookups skip the field's validators #80
Priority: medium. Writes run a field's validators, but reads by key and index queries do not, so a normalizing validator makes items unreachable:
With the guide's email = field(unique=True, validators=(str.lower,)) and GlobalIndex(partition_key=email), querying email="[email protected]" returns [], while the item stores [email protected].
With a normalizing validator on a partition_key, get() returns None.
Template components already run validators (schema.py, _key_value), so templated keys work; plain key fields and index keys do not (schema.py, key_from/index_key, which call only the codec's validate).
Fix: validate key and index key values with FieldSpec.validate (validators included), as templates do.
Found in a review of the library for bugs (fctl session); the fixes that fit in its ten pull requests are #61 to #65, #67 to #70 and #72.
Activity