refactor(dynamodb): split evaluate_single_key_condition + find_partiql_where_indices#353
Merged
vieiralucas merged 1 commit intomainfrom Apr 13, 2026
Merged
Conversation
…l_where_indices evaluate_single_key_condition split into key_cond_begins_with / key_cond_between / key_cond_simple_comparison so the dispatch function is a 12-line guard ladder. The 'key_cond_' prefix avoids collision with the existing eval_begins_with that backs the FilterExpression evaluator — the two share the function-call grammar but have different return types and operand-type handling, so they intentionally stay separate. find_partiql_where_indices split into split_partiql_and_clauses (the case-insensitive AND splitter) and parse_partiql_equality_conditions (the col = literal pair extractor). The outer function is now a 12-line filter loop. Other DynamoDB targets in the original audit list judged already-clean: parse_path_segments (single-pass char state machine, 40L), apply_update_expression (40L dispatch over UpdateAction enum), parse_update_clauses (35L focused on keyword-position scan), assign_list_index (small), evaluate_size_comparison (45L, two clear sub-tasks already inline).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Already-clean targets from the original audit list (judged not worth splitting)
Test plan
Summary by cubic
Refactors DynamoDB expression evaluators by splitting two large functions into small, focused helpers with no behavior changes. This simplifies key-condition and PartiQL WHERE processing and makes them easier to test.
Written for commit 5a55fe1. Summary will update on new commits.