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:
Amin Ghadersohi
2026-03-13 12:46:52 +01:00
committed by Michael S. Molina
parent e41653faff
commit b3eaa5ad01
25 changed files with 297 additions and 72 deletions

View File

@@ -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(