bito-code-review[bot] commented on code in PR #44627:
URL: https://github.com/apache/superset/pull/44627#discussion_r4158887727
##########
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:
<!-- Bito Reply -->
The suggestion to reuse `DatabricksBaseEngineSpec._extended_aggregations` by
reference is appropriate. It establishes a single source of truth for these
aggregate functions, which helps prevent potential semantic divergence between
the base spec and the hive-specific spec.
**superset/db_engine_specs/databricks.py**
```
_extended_aggregations = DatabricksBaseEngineSpec._extended_aggregations
```
--
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]