aminghadersohi opened a new pull request, #37214:
URL: https://github.com/apache/superset/pull/37214
### SUMMARY
Runtime validation warnings in the MCP service were incorrectly treated as
hard errors that blocked chart generation entirely. This caused valid chart
requests to fail with misleading "performance_warning" errors like:
- "Table with mostly aggregated metrics could be visualized as a chart"
- "Configuration may cause performance issues"
These messages are meant to be **suggestions**, not blockers. A user
creating a bar chart shouldn't have their request fail because the validator
thinks a different chart type might work better.
**Changes:**
1. **RuntimeValidator** now returns warnings as metadata (`Dict`) instead of
errors
2. **ValidationPipeline** passes warnings through via new `ValidationResult`
class with `validate_request_with_warnings()` method
3. **generate_chart** tool includes warnings in successful response's
`warnings` field
4. Updated default URL from port 9001 to 9081 for local development
**Before:** Warnings caused `return False, error` → chart generation failed
**After:** Warnings return `return True, warnings_metadata` → chart succeeds
with informational warnings
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A - Backend changes only
### TESTING INSTRUCTIONS
1. Start the MCP service locally
2. Call `generate_chart` with a table chart that has aggregated metrics:
```json
{
"dataset_id": 1,
"config": {
"chart_type": "table",
"columns": [
{"name": "product_name"},
{"name": "revenue", "aggregate": "SUM"}
]
}
}
```
3. **Before:** Request would fail with "performance_warning" error
4. **After:** Request succeeds with warnings in response:
```json
{
"success": true,
"chart": {...},
"warnings": ["Table with mostly aggregated metrics could be visualized
as a chart"]
}
```
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]