mirror of
https://github.com/apache/superset.git
synced 2026-05-28 11:15:24 +00:00
get_chart_data with format=excel could fail with "Parent instance SqlaTable is not bound to a Session; lazy load operation of attribute metrics cannot proceed" when the dataset's metrics relationship was accessed after the request-scoped session detached. Pass a subqueryload(Slice.table -> SqlaTable.metrics) query option on ChartDAO lookup so metrics are materialized up front and later detachment is harmless. Mirrors the eager-loading pattern from #39206. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>