bito-code-review[bot] commented on PR #43571:
URL: https://github.com/apache/superset/pull/43571#issuecomment-5438341019

   <!-- Bito Reply -->
   The flagged issue is correct. The `RadarChartConfig` schema currently 
enforces a minimum of one metric (`min_length=1`), which allows degenerate 
radar charts that contradict the plugin's requirement for multiple axes. To 
resolve this, update the `min_length` constraint in 
`superset/mcp_service/chart/schemas.py` to `2` and update the `pre_validate` 
method in `superset/mcp_service/chart/plugins/radar.py` to enforce this minimum.
   
   Would you like me to implement these changes and check the rest of the PR 
comments for similar issues?
   
   **superset/mcp_service/chart/schemas.py**
   ```
   metrics: List[ColumnRef] = Field(
           ...,
           min_length=2,
           description="Value metrics forming the radar axes (one axis per "
           "metric; radars read best with 3 or more)",
       )
   ```
   
   **superset/mcp_service/chart/plugins/radar.py**
   ```
   if len(config.get("metrics", [])) < 2:
               return ChartGenerationError(
                   error_type="missing_radar_fields",
                   message="Radar chart requires at least two metrics",
                   details="Radar charts plot one axis per metric. Add two or 
more 'metrics'.",
                   error_code="MISSING_RADAR_FIELDS",
               )
   ```


-- 
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]

Reply via email to