diff --git a/superset/connectors/sqla/models.py b/superset/connectors/sqla/models.py index a6df8a93cacca..6587f5e966432 100644 --- a/superset/connectors/sqla/models.py +++ b/superset/connectors/sqla/models.py @@ -303,8 +303,10 @@ def get_time_filter( return and_(*l) def get_timestamp_expression( - self, time_grain: Optional[str], label: Optional[str] = None, - template_processor: Optional[BaseTemplateProcessor] = None + self, + time_grain: Optional[str], + label: Optional[str] = None, + template_processor: Optional[BaseTemplateProcessor] = None, ) -> Union[TimestampExpression, Label]: """ Return a SQLAlchemy Core element representation of self to be used in a query. @@ -1096,7 +1098,8 @@ def get_sqla_query( # pylint: disable=too-many-arguments,too-many-locals,too-ma outer = table_col.get_timestamp_expression( time_grain=time_grain, label=selected, - template_processor=template_processor) + template_processor=template_processor, + ) # if groupby field equals a selected column elif table_col: outer = table_col.get_sqla_col() @@ -1130,8 +1133,8 @@ def get_sqla_query( # pylint: disable=too-many-arguments,too-many-locals,too-ma if is_timeseries: timestamp = dttm_col.get_timestamp_expression( - time_grain=time_grain, - template_processor=template_processor) + time_grain=time_grain, template_processor=template_processor + ) # always put timestamp as the first column select_exprs.insert(0, timestamp) groupby_all_columns[timestamp.name] = timestamp @@ -1197,8 +1200,8 @@ def get_sqla_query( # pylint: disable=too-many-arguments,too-many-locals,too-ma if col_obj: if filter_grain: sqla_col = col_obj.get_timestamp_expression( - time_grain=filter_grain, - template_processor=template_processor) + time_grain=filter_grain, template_processor=template_processor + ) else: sqla_col = col_obj.get_sqla_col() col_spec = db_engine_spec.get_column_spec(col_obj.type)