villebro commented on a change in pull request #16139:
URL: https://github.com/apache/superset/pull/16139#discussion_r685371853
##########
File path: superset/connectors/sqla/models.py
##########
@@ -303,13 +307,15 @@ def get_timestamp_expression(
pdf = self.python_date_format
is_epoch = pdf in ("epoch_s", "epoch_ms")
+ column_spec = self.db_engine_spec.get_column_spec(self.type)
+ type_ = column_spec.sqla_type if column_spec else DateTime
if not self.expression and not time_grain and not is_epoch:
- sqla_col = column(self.column_name, type_=DateTime)
+ sqla_col = column(self.column_name, type_=type_)
Review comment:
Good idea; I added tests for this (now the type is the
"TemporalWrapperType" which is asserted for in the
`test_get_timestamp_expression` test)
--
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]