villebro commented on code in PR #21489:
URL: https://github.com/apache/superset/pull/21489#discussion_r972675378


##########
superset/connectors/sqla/models.py:
##########
@@ -1144,9 +1144,10 @@ def adhoc_column_to_sqla(
             and (time_grain := col.get("timeGrain"))
         ):
             sqla_column = self.db_engine_spec.get_timestamp_expr(
-                sqla_column,
-                None,
-                time_grain,
+                col=sqla_column,
+                pdf=None,
+                time_grain=time_grain,
+                type_=str(getattr(sqla_column, "type", "")),

Review Comment:
   Could we refactor this so that `type_` is removed from the 
`BaseEngineSpec.get_timestamp_expr` sig and we then use `sqla_column.type` 
inside the method for `type_`? Or is the explicit `type_` needed somewhere 
else? I looked here, and I think we can infer the type from `ColumnClause.type` 
here, too.



-- 
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]

Reply via email to