aminghadersohi commented on code in PR #38416:
URL: https://github.com/apache/superset/pull/38416#discussion_r2931760284
##########
superset/mcp_service/chart/tool/list_charts.py:
##########
@@ -142,9 +188,16 @@ def _serialize_chart(
)
# Apply field filtering via serialization context
- # Always use columns_requested (either explicit select_columns or
defaults)
- # This triggers ChartInfo._filter_fields_by_context for each chart
columns_to_filter = result.columns_requested
+ # Re-add popularity_score if it was originally requested
+ # (it was stripped before the DAO query since it's computed)
+ if (
+ request.select_columns
+ and "popularity_score" in request.select_columns
+ and columns_to_filter
+ and "popularity_score" not in columns_to_filter
+ ):
+ columns_to_filter = list(columns_to_filter) + ["popularity_score"]
Review Comment:
Fixed in bad796b. Response filtering now uses the original
`request.select_columns` (saved before DAO mutation) instead of
`result.columns_requested` (which reflected DAO-expanded columns with injected
`id`). When no explicit columns requested, falls back to
`result.columns_requested` with DAO defaults.
##########
superset/mcp_service/dashboard/tool/list_dashboards.py:
##########
@@ -144,9 +179,16 @@ def _serialize_dashboard(
)
# Apply field filtering via serialization context
- # Always use columns_requested (either explicit select_columns or defaults)
- # This triggers DashboardInfo._filter_fields_by_context for each dashboard
columns_to_filter = result.columns_requested
+ # Re-add popularity_score if it was originally requested
+ # (it was stripped before the DAO query since it's computed)
+ if (
+ request.select_columns
+ and "popularity_score" in request.select_columns
+ and columns_to_filter
+ and "popularity_score" not in columns_to_filter
+ ):
+ columns_to_filter = list(columns_to_filter) + ["popularity_score"]
Review Comment:
Fixed in bad796b. Response filtering now uses the original
`request.select_columns` (saved before DAO mutation) instead of
`result.columns_requested` (which reflected DAO-expanded columns with injected
`id`). When no explicit columns requested, falls back to
`result.columns_requested` with DAO defaults.
--
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]