bito-code-review[bot] commented on code in PR #44627:
URL: https://github.com/apache/superset/pull/44627#discussion_r4144082794
##########
superset/db_engine_specs/databricks.py:
##########
@@ -1101,6 +1114,16 @@ class DatabricksHiveEngineSpec(HiveEngineSpec):
_time_grain_expressions = time_grain_expressions
+ # Interactive Clusters run Spark SQL, same as the primary Databricks
+ # connector above; same native MEDIAN/STDDEV_SAMP/VAR_SAMP functions
+ # apply here rather than the inherited (unimplemented) HiveEngineSpec/
+ # PrestoEngineSpec default.
+ _extended_aggregations: dict[str, Callable[[ColumnElement],
ColumnElement]] = {
+ "MEDIAN": sa.func.median,
+ "STDDEV_SAMP": sa.func.stddev_samp,
+ "VAR_SAMP": sa.func.var_samp,
+ }
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Duplicated aggregate dict</b></div>
<div id="fix">
This dict is byte-identical to
`DatabricksBaseEngineSpec._extended_aggregations` (lines 268-272). Since both
specs target Spark SQL, divergence would silently change aggregate semantics.
Reuse the base dict by reference (as `SnowflakeEngineSpec` does with
`PostgresBaseEngineSpec`) to keep a single source of truth.
</div>
</div>
<small><i>Code Review Run #8f1669</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]