fix(memory): skip non-dict models/rels/views in extract_schema_items#2541
fix(memory): skip non-dict models/rels/views in extract_schema_items#2541Bartok9 wants to merge 3 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
WalkthroughSchema extraction now validates manifest item and column shapes, skips entries without valid names, and safely builds model column summaries. A new unit test covers mixed valid and malformed models, columns, relationships, and views. ChangesSchema extraction hardening
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@core/wren/src/wren/memory/schema_indexer.py`:
- Around line 244-254: Update extract_schema_items to require rel.get("name") is
not None before passing relationship dictionaries to _relationship_record, and
apply the same guard to view dictionaries before calling _view_record. Preserve
processing of named entries while skipping unnamed relationships and views to
avoid KeyError.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 65724ab9-98a5-437d-bac9-4f23cb51c05c
📒 Files selected for processing (2)
core/wren/src/wren/memory/schema_indexer.pycore/wren/tests/unit/test_schema_extract_nonduct_models.py
Skip relationship/view entries lacking a name so _relationship_record / _view_record no longer KeyError on malformed manifests, matching the existing models guard. Addresses CodeRabbit review feedback on Canner#2541.
Summary
extract_schema_itemsignores non-dict models/relationships/views and nameless/non-dict columns._model_recordcolumn summary only joins dict columns with names.License
Apache-2.0 path under
core/wren.Verification
cd core/wren && .venv/bin/python -m pytest tests/unit/test_schema_extract_nonduct_models.py -qTest plan
Summary by CodeRabbit