bito-code-review[bot] commented on code in PR #44148: URL: https://github.com/apache/superset/pull/44148#discussion_r4125665781
########## superset/mcp_service/chart/plugin.py: ########## @@ -27,19 +27,28 @@ from __future__ import annotations -from collections.abc import Mapping +from collections.abc import Callable, Mapping from typing import Any, ClassVar, Protocol, runtime_checkable -from superset.mcp_service.chart.schemas import ColumnRef +from superset.mcp_service.chart.schemas import ChartError, ColumnRef, VegaLitePreview from superset.mcp_service.common.error_schemas import ChartGenerationError +def capped_compile_row_limit(form_data: Mapping[str, Any], cap: int = 10) -> int: Review Comment: <div> <div id="suggestion"> <div id="issue"><b>Magic cap default 10</b></div> <div id="fix"> `capped_compile_row_limit` hardcodes the compile-sample cap as the default `cap: int = 10`. The sibling `_typed_row_limit` in `geographic.py` names its equivalent bound `MAX_GEOGRAPHIC_ROWS`, and `gauge.py:215` / `treemap.py:218` inherit this value silently via `compile_row_limit`. A named module constant would make the business limit greppable and prevent silent drift. </div> </div> <details> <summary><b>Citations</b></summary> <ul> <li> Rule Violated: <a href="https://github.com/apache/superset/blob/e16967b/.cursor/rules/dev-standard.mdc#L119">dev-standard.mdc:119</a> </li> </ul> </details> <small><i>Code Review Run #5407b3</i></small> </div> --- Should Bito avoid suggestions like this for future reviews? (<a href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>) - [ ] Yes, avoid them -- 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]
