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

   <!-- Bito Reply -->
   The heuristic in `_route_x_axis_key` correctly identifies the edge case you 
described. Because the logic relies on `set(value) & 
set(AxisConfig.model_fields)` to determine if a dictionary is styling, a 
payload with only mistyped keys (e.g., `{"titel": "State"}`) will result in an 
empty intersection, causing the heuristic to treat it as a column reference and 
route it to `x`.
   
   This behavior is indeed a boundary of the current implementation. While it 
surfaces an 'Unknown field' error against the column rather than the styling 
config, this is consistent with the heuristic's design to prioritize column 
routing when no valid styling fields are detected. Given that such a payload is 
functionally unusable, this trade-off is acceptable for the current scope.
   
   **superset/mcp_service/chart/schemas.py**
   ```
   is_column_ref = isinstance(value, str) or (
           isinstance(value, dict)
           and bool(value)
           and not set(value) & set(AxisConfig.model_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