bito-code-review[bot] commented on PR #40339:
URL: https://github.com/apache/superset/pull/40339#issuecomment-4556852256
<!-- Bito Reply -->
The PR comment indicates a potential issue with the
`_resolve_deck_gl_metrics` function in `chart_helpers.py`, where it may
incorrectly apply metric extraction to `deck_geojson` visualizations. This
could lead to invalid aggregation for GeoJSON charts without a saved
`query_context`. The suggested fix is to make the metric extraction
viz-type-aware, specifically handling `deck_geojson` to force `metrics=[]`,
aligning with the established behavior in `DeckGeoJson.query_obj`.
Additionally, a regression test should be added to ensure the fallback produces
a columns-only query for GeoJSON form_data that includes a `size` value.
**superset/mcp_service/chart/chart_helpers.py**
```
def _resolve_deck_gl_metrics(form_data):
viz_type = form_data.get('viz_type')
if viz_type == 'deck_geojson':
form_data['metrics'] = []
form_data['groupby'] = []
# Existing logic for other viz types
# ...
return form_data
```
--
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]