Skip to content

Key and index lookups skip the field's validators #80

Closed

Description

@fctl-sh

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

  1. added
    bug
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions