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
Queries: count() of projected reads fails, and sort key fields shared with the partition key are refused #85
count() of a projected read always fails (query.py, count()): it drops the projection but sends its attribute names, so Note.query(client, user_id="u1").project(Note.text).count() fails with ValidationException: Value provided in ExpressionAttributeNames unused in expressions, and a scan without other expressions with "ExpressionAttributeNames can only be specified when using expressions". table.query(...).project("text").count() fails the same way.
scan().after(cursor).segments(n).count() applies one segment's cursor to every segment (query.py, count()): iteration refuses this ("a parallel scan reads every segment from its start"), count() returns a wrong number (35 for 40 items).
query() and count() refuse sort key fields that repeat a partition key field (repository.py, building the partition key consumes the shared field): with pk "ORG#{org_id}" and sk "MEMBER#{org_id}#{user_id}", Membership.get(client, org_id="o1", user_id="u1") works but Membership.query(client, org_id="o1", user_id="u1") raises ValueError: ... unexpected arguments user_id; the same for index keys such as "STATUS#{status}"/"{status}#{placed_at}".
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