Conversation
WalkthroughThe changes fix pattern matching translation for right-node-bound scenarios and shortest-path queries by introducing a Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
| Queries that contain similar constructs will result in the following translation error: | ||
| `ERROR: column notation .id applied to type nodecomposite[], which is not a composite type (SQLSTATE 42809)`. | ||
|
|
||
| ### Right-Hand Bound Node Lookups |
There was a problem hiding this comment.
The pattern noted here (and a few related patterns) has been fixed though it is unclear whether all possible occurrences of right-hand bound node lookups have been addressed.
Is removing this documentation premature?
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cypher/models/pgsql/translate/expansion.go (1)
128-139:⚠️ Potential issue | 🔴 CriticalFix line 401: change condition check to
PrimerNodeJoinCondition.Lines 128 and 300 correctly check
if expansionModel.PrimerNodeJoinCondition != nilbefore adding the primer node join, but line 401 inprepareBackwardFrontRecursiveQueryincorrectly checksif expansionModel.PrimerNodeConstraints != nil. Since the join usess.traversalStep.Expansion.PrimerNodeJoinConditionas its constraint, the condition should match the field being used. Change line 401 to checkPrimerNodeJoinConditionfor consistency with the other two primer query functions and to ensure the join is added based on actual join condition presence rather than filter constraint presence.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@cypher/models/pgsql/translate/expansion.go` around lines 128 - 139, The prepareBackwardFrontRecursiveQuery function incorrectly checks expansionModel.PrimerNodeConstraints before adding the primer node join; update that condition to check expansionModel.PrimerNodeJoinCondition so it matches the join's Constraint usage (s.traversalStep.Expansion.PrimerNodeJoinCondition) and aligns with the checks in the other primer query functions (see the similar blocks that use expansionModel.PrimerNodeJoinCondition to append to nextQueryFrom.Joins).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@cypher/models/pgsql/translate/expansion.go`:
- Around line 128-139: The prepareBackwardFrontRecursiveQuery function
incorrectly checks expansionModel.PrimerNodeConstraints before adding the primer
node join; update that condition to check expansionModel.PrimerNodeJoinCondition
so it matches the join's Constraint usage
(s.traversalStep.Expansion.PrimerNodeJoinCondition) and aligns with the checks
in the other primer query functions (see the similar blocks that use
expansionModel.PrimerNodeJoinCondition to append to nextQueryFrom.Joins).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d44fbecb-98c0-40f5-8d9b-a79b820a07bd
📒 Files selected for processing (8)
cypher/Cypher Syntax Support.mdcypher/models/pgsql/test/translation_cases/multipart.sqlcypher/models/pgsql/test/translation_cases/pattern_binding.sqlcypher/models/pgsql/test/translation_cases/pattern_expansion.sqlcypher/models/pgsql/test/translation_cases/shortest_paths.sqlcypher/models/pgsql/translate/expansion.gocypher/models/pgsql/translate/pattern.gocypher/models/pgsql/translate/traversal.go
💤 Files with no reviewable changes (1)
- cypher/Cypher Syntax Support.md
Single step and expansion relationship patterns are updated to handle bindings associated with the right node.
Test cases that reflect the patterns in the reported issues have been added.
The okta example in the ticket:

Simplied BP-1590 pattern:

Shortest path, gh issue/BP-2257:

Summary by CodeRabbit
Release Notes
Bug Fixes
Documentation