mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
fix(mcp): fix crashes in list tools, dataset info, chart preview, and add owner/favorite filters (#38277)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
(cherry picked from commit d5cf77cd60)
This commit is contained in:
committed by
Michael S. Molina
parent
e41653faff
commit
b3eaa5ad01
@@ -478,6 +478,8 @@ def configure_temporal_handling(
|
||||
For temporal columns, enables standard time series handling.
|
||||
For non-temporal columns (e.g., BIGINT year), disables DATE_TRUNC
|
||||
by setting categorical sorting options.
|
||||
|
||||
Stores any warnings in ``form_data["_mcp_warnings"]``.
|
||||
"""
|
||||
if x_is_temporal:
|
||||
if time_grain:
|
||||
@@ -488,6 +490,12 @@ def configure_temporal_handling(
|
||||
form_data["x_axis_sort_series_ascending"] = True
|
||||
form_data["time_grain_sqla"] = None
|
||||
form_data["granularity_sqla"] = None
|
||||
if time_grain:
|
||||
form_data.setdefault("_mcp_warnings", []).append(
|
||||
f"time_grain='{time_grain}' was ignored because the x-axis "
|
||||
f"column is not a temporal type. time_grain only applies to "
|
||||
f"DATE/DATETIME/TIMESTAMP columns."
|
||||
)
|
||||
|
||||
|
||||
def map_xy_config(
|
||||
|
||||
Reference in New Issue
Block a user