zhaoyongjie commented on a change in pull request #16680:
URL: https://github.com/apache/superset/pull/16680#discussion_r707346703
##########
File path: superset/connectors/sqla/models.py
##########
@@ -953,12 +953,20 @@ def get_sqla_query( # pylint:
disable=too-many-arguments,too-many-locals,too-ma
apply_fetch_values_predicate: bool = False,
) -> SqlaQuery:
"""Querying any sqla table from this common interface"""
+ if granularity not in self.dttm_cols and granularity is not None:
+ granularity = self.main_dttm_col
+
+ extras = extras or {}
+ time_grain = extras.get("time_grain_sqla")
+
template_kwargs = {
"from_dttm": from_dttm.isoformat() if from_dttm else None,
"groupby": groupby,
"metrics": metrics,
"row_limit": row_limit,
"row_offset": row_offset,
+ "time_column": granularity,
Review comment:
nice!
--
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]