fix(mcp): harden list_cubes member arrays - #2617
Conversation
list_cubes assumed cube members were always lists of dicts. Skip non-dict cubes and member rows so malformed cube YAML cannot crash MCP.
Walkthrough
ChangesCube enumeration robustness
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
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 |
|
Reviewing this together with #2615 — the MCP half of one change. #2615 and #2617 harden the same cube listing behind two entry points — the The two data sources differ, and that decides which guards are liveMCP So in #2617 the two cube-level guards are dead and only The CLI reads A scalar What to doFold the two into one PR that:
Better still, follow 9bdae39 (#2604): if member arrays should be trustworthy, normalise them once in RebaseBoth branches are 17 commits behind |
|
Thanks @goldmedal — agreed on the data-source boundary analysis. Plan:
Will open the consolidated PR shortly and link both of these from it. |
What failure does this repair?
MCP
list_cubesraisedAttributeError: 'str' object has no attribute 'get'when a cube'smeasures/dimensions/time_dimensionswas non-list or held non-dict members. Repro: call thelist_cubestool against a manifest whose cube has"measures": ["revenue"]— name extraction called.get("name")on the string and the tool failed.Summary
list_cubesnow ignores invalid cube entries and extracts names only from valid dictionary members.Verification
Duplicate check
Searched open/closed PRs; #2615 hardens related cube listing but not the member-array normalization in this path. No overlap.