bito-code-review[bot] commented on code in PR #38977:
URL: https://github.com/apache/superset/pull/38977#discussion_r3016213645


##########
superset/mcp_service/chart/tool/get_chart_data.py:
##########
@@ -369,6 +369,38 @@ async def get_chart_data(  # noqa: C901
                 # Bubble charts use x/y/size as separate metric fields.
                 viz_type = chart.viz_type or ""
 
+                # Deck.gl chart types store spatial data (lat/lon)
+                # rather than traditional metrics/groupby. They
+                # require a saved query_context to retrieve data.
+                deck_gl_types = (
+                    "deck_arc",
+                    "deck_geojson",
+                    "deck_grid",
+                    "deck_hex",
+                    "deck_multi",
+                    "deck_path",
+                    "deck_polygon",
+                    "deck_scatter",
+                    "deck_screengrid",
+                )

Review Comment:
   <!-- Bito Reply -->
   Using `viz_type.startswith('deck_')` is a solid fix—it dynamically covers 
all deck.gl types, including future ones, avoiding maintenance of a hardcoded 
list.
   
   **superset/mcp_service/chart/tool/get_chart_data.py**
   ```
   if viz_type.startswith("deck_"):
                       await ctx.warning(
                           "Chart %s is a deck.gl visualization (%s) with no "
                           "saved query_context. Data retrieval requires "
                           "re-saving the chart in Superset." % (chart.id, 
viz_type)
                       )
                       return ChartError(
                           error=(
                               f"Chart {chart.id} is a deck.gl visualization "
                               f"(type: {viz_type}) with no saved 
query_context. "
                               f"Deck.gl charts use spatial data (lat/lon) that 
"
                               f"cannot be reconstructed from form_data alone. "
                               f"Please open this chart in Superset and re-save 
"
                               f"it to generate a query_context."
                           ),
                           error_type="MissingQueryContext",
                       )
   ```



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