codeant-ai-for-open-source[bot] commented on code in PR #41860:
URL: https://github.com/apache/superset/pull/41860#discussion_r3575564706
##########
superset/mcp_service/chart/chart_utils.py:
##########
@@ -891,6 +893,64 @@ def map_pie_config(config: PieChartConfig) -> Dict[str,
Any]:
return form_data
+def map_histogram_config(config: "HistogramChartConfig") -> Dict[str, Any]:
+ """Map histogram config to Superset form_data (viz_type histogram_v2).
+
+ Matches the frontend Histogram buildQuery contract: a single ``column``
+ string to bin, ``groupby`` name list for series, plus bins/normalize/
+ cumulative passed straight through to the histogram post-processing
+ operator.
+ """
+ form_data: Dict[str, Any] = {
+ "viz_type": "histogram_v2",
+ "column": config.column.name,
+ "groupby": [g.name for g in (config.groupby or [])],
+ "bins": config.bins,
+ "normalize": config.normalize,
+ "cumulative": config.cumulative,
+ "row_limit": config.row_limit,
+ }
+ _add_adhoc_filters(form_data, config.filters)
+ return form_data
+
+
+# The exact strings the frontend boxplotOperator understands; the percentile
+# variant must match its PERCENTILE_REGEX: "<low>/<high> percentiles".
+_WHISKER_TYPE_TO_OPTION = {
+ "tukey": "Tukey",
Review Comment:
✅ **Customized review instruction saved!**
**Instruction:**
> Do not flag module-level constants, locals, or lambdas with inferable
types for missing type annotations when the codebase already follows this
pattern and mypy passes; only flag cases where the type is ambiguous or a type
hint is required for correctness.
**Applied to:**
- `**/*.py`
---
💡 *To manage or update this instruction, visit: [CodeAnt AI
Settings](https://app.codeant.ai/org/settings/learnings)*
--
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]