Repository navigation
feat: add support for NOT EXISTS / NOT EXIST comparator - #9
Merged
Merged
Conversation
pinzon
self-requested a review
September 28, 2026 19:25
pinzon
approved these changes
Sep 29, 2026
pinzon
left a comment
Member
There was a problem hiding this comment.
LGTM. Thank you for contributing to this project
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.
Closes #8
Description
CloudWatch filter expressions support checking whether a JSON attribute does not exist using the
NOT EXISTSsyntax (e.g.{ $.SomeOtherObject NOT EXISTS }). This PR extends the Lark grammar and matcher parser to support this comparator.Key Changes
grammar.lark):comparison: ... | entity NOT_EXISTS -> not_existsNOT_EXISTS: /(?i:NOT\s+EXISTS?)/terminal matching bothNOT EXISTSandNOT EXISTcase-insensitively with flexible whitespace.matcher.py):MISSINGsentinel object to distinguish between absent attributes and attributes explicitly set tonull(None).not_existshandler inFilterEvaluatorto returnTruewhen the resolved entity isMISSING.resolve_entityto safely traverse nested objects, dictionaries, and list indices without raisingAttributeErrororKeyErroron missing intermediate paths.False.extract_booleanto support raw booleans as well as AST nodes.tests/test_parser.py(including invalid syntax error cases).tests/test_matcher.py(missing fields, present fields, nested paths, list indices, null values, and combined logical expressions).