fix(memory): reject non-list relationship models in seed queries - #2606
fix(memory): reject non-list relationship models in seed queries#2606Bartok9 wants to merge 1 commit into
Conversation
Walkthrough
ChangesRelationship models validation
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
core/wren/tests/unit/test_seed_queries.py (1)
819-842: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd coverage for
models: null.The implementation intentionally treats
Noneas an empty list, but these tests cover only rejected string and dictionary values. Add a case asserting that a relationship withmodels=Noneproduces no relationship seed.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@core/wren/tests/unit/test_seed_queries.py` around lines 819 - 842, Add a unit test to TestRelationshipSeedModelsType covering a relationship whose models value is None, and assert generate_seed_queries returns no relationship seed for that manifest. Keep the existing rejection tests for string and dictionary values unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@core/wren/tests/unit/test_seed_queries.py`:
- Around line 819-842: Add a unit test to TestRelationshipSeedModelsType
covering a relationship whose models value is None, and assert
generate_seed_queries returns no relationship seed for that manifest. Keep the
existing rejection tests for string and dictionary values unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b9bf5ecf-889e-48ca-a1cd-e37bc32fdf61
📒 Files selected for processing (2)
core/wren/src/wren/memory/seed_queries.pycore/wren/tests/unit/test_seed_queries.py
Summary
generate_seed_queriesraisesValueErroron non-listrelationship.modelsinstead of index/string-slice bugs.Motivation
Same structural policy as schema_indexer (#2590 / #2533). Seeds must not invent join endpoints from a string's first characters.
Real behavior proof
Test plan
modelsraise; suite otherwise unchangedSummary by CodeRabbit
Bug Fixes
Tests