Skip to content

fix(scan): drop the FilterExpression suffix from the values message - #765

Open
LeeroyHannigan wants to merge 1 commit into
mainfrom
fix/722-scan-eav-suffix
Open

LeeroyHannigan wants to merge 1 commit into
mainfrom
fix/722-scan-eav-suffix

Conversation

@LeeroyHannigan

Copy link
Copy Markdown
Collaborator

A Scan that carries ExpressionAttributeValues and no FilterExpression answered ExpressionAttributeValues can only be specified when using expressions: FilterExpression is null. Amazon DynamoDB ends the message after expressions.

Change

handle_scan passes an empty parameter list to validate_expression_param_usage, as handle_query does, so the message carries no suffix. test_scan_values_no_expression in tests/test_expression_param_usage.py expects the bare message. The module docstring, the comment on the Query test and the doc comment of validate_expression_param_usage no longer describe a Scan suffix.

Measurement

Amazon DynamoDB, us-east-1, 2 November 2026, each request sent twice with identical answers. Every request carries "ExpressionAttributeValues": {":v": {"S": "x"}} and no expression:

Request Service answer
Scan, table that does not exist ValidationException: ExpressionAttributeValues can only be specified when using expressions
Scan, existing table, pk S HASH, sk S RANGE the same
Scan with "ProjectionExpression": "a" the same
Scan with a ScanFilter the same
Query with KeyConditions on pk the same

The 31 October measurement in #722 found the same Scan answer on eight further requests. Query already answers the bare message on main.

Testing

  • cargo +1.97.0 fmt --all -- --check and cargo +1.97.0 clippy -p extenddb-engine -p extenddb-core --all-targets -- -D warnings: clean.
  • cargo +1.88.0 test --locked -p extenddb-engine -p extenddb-core: 911 passed.
  • devtools/run-tests --extenddb --pytest --filter test_expression_param_usage against a sqlite-memory,dev-mode build: 12 passed. With the old &[ExpressionKind::Filter] restored, test_scan_values_no_expression fails and the other 11 pass.

Overlap with #399

The same run found that PutItem, DeleteItem and UpdateItem answer both messages with a 1 validation error detected: prefix and name no parameter. #399 makes that change. It also rewrites this file's module docstring, where it describes the Scan message with the FilterExpression is null suffix. The two pull requests conflict on the docstring only; whichever lands second keeps this pull request's description of Scan.

Fixes #722.

A Scan that carries ExpressionAttributeValues and no FilterExpression
answered "ExpressionAttributeValues can only be specified when using
expressions: FilterExpression is null". Amazon DynamoDB ends the message
after "expressions", on a table that exists and on one that does not, with
or without a ProjectionExpression or a ScanFilter (measured in us-east-1).

handle_scan now passes an empty parameter list to
validate_expression_param_usage, as Query does, so the message carries no
suffix. The dual-target test expects the bare message.

Fixes #722.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scan: ExpressionAttributeValues without an expression answers with a ": FilterExpression is null" suffix the service does not send

1 participant