fix: EXISTS {} inner anonymous node with properties no longer raises ValidationError#496
Conversation
…ValidationError (#474) _plan_match passed node_pattern.variable (which can be None for anonymous nodes) to _properties_to_predicate, causing a Pydantic ValidationError. Fix: use var_name instead — already set to the generated anon name at line 791 for nameless nodes. Adds four integration tests covering all acceptance criteria: anonymous inner node with outer-var property, outer var in inner WHERE, outer var in IN expression, and the full ontology conformance query from the issue. Closes #474
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThe planner's single-node MATCH pattern builder now uses the resolved internal variable name when constructing inline property predicates, fixing a bug where anonymous pattern nodes (lacking explicit variables) would fail with validation errors during EXISTS subquery planning. ChangesPlanner Fix for EXISTS Subqueries with Outer Variables
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #496 +/- ##
==========================================
- Coverage 88.02% 88.02% -0.01%
==========================================
Files 40 40
Lines 14471 14470 -1
Branches 3434 3434
==========================================
- Hits 12738 12737 -1
Misses 1142 1142
Partials 591 591
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
Closes #474
Summary
EXISTS { MATCH (:Label {prop: outer.var}) }raisedValidationError: PropertyAccess requires either 'variable' or 'base'when the inner node was anonymous (no explicit variable name)_plan_matchpassednode_pattern.variable(which isNonefor anonymous nodes) to_properties_to_predicate, butvar_nameon the line above already resolves the correct name (real or generated anon)var_nameinstead ofnode_pattern.variableat the call siteTest plan
test_anonymous_inner_node_with_outer_property— exact failure case from issuetest_outer_variable_in_inner_where— outer var referenced in innerWHEREtest_outer_variable_in_in_expression— outer var inINexpressiontest_ontology_conformance_query— full repro from issue, domain-violation rows correctmake pre-pushgreen (87.08% total coverage)🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmithwith what you need.Summary by CodeRabbit