fix: return empty string for empty filter list in parse_metadata_filters_recursive - #415
Open
evanerwee wants to merge 1 commit into
Open
fix: return empty string for empty filter list in parse_metadata_filters_recursive#415evanerwee wants to merge 1 commit into
evanerwee wants to merge 1 commit into
Conversation
…ers_recursive When MetadataFilters has an empty filters list, the function previously returned '()' (from joining an empty list within parentheses). This truthy string bypassed the guard in VersionManager._get_existing_source_nodes(), causing invalid Cypher: WHERE () AND <filter> Neptune Database rejects this with MalformedQueryException: Invalid input 'A': expected whitespace, comment or a relationship pattern Fix: return '' (empty string) when filter_strs is empty, before reaching the condition-based join logic. Fixes awslabs#408
mykola-pereyma
approved these changes
Jul 23, 2026
mykola-pereyma
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. Thank you!
oussamahansal
approved these changes
Jul 23, 2026
Collaborator
|
@evanerwee Can you please resolve the conflict and rebase before we merge it. Thank you! |
This was referenced Jul 24, 2026
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
When
MetadataFiltershas an emptyfilterslist,parse_metadata_filters_recursivereturns"()"(from joining an empty list within parentheses). This truthy string bypasses the guard inVersionManager._get_existing_source_nodes()at line 70:This causes the VersionManager to generate invalid Cypher:
Neptune Database (1.4.7.0) rejects this with:
Fix
Return
''(empty string) whenfilter_strsis empty, before reaching the condition-based join logic.Testing
__property names)Evidence
Direct Neptune testing results (from issue #408):
RETURN {id: id(n)} AS result__aws__property namest.__aws__versioning__id_fields__coalesce(t.__aws__versioning__valid_from__, -1)WHERE () AND id(n) IS NOT NULLFixes #408