Skip to content

Commit

Permalink
fix: the calculated columns explicit type convert into date (#14813)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyongjie committed May 26, 2021
1 parent 3224e75 commit 6bdbd2b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion superset/connectors/sqla/models.py
Expand Up @@ -309,7 +309,8 @@ def dttm_sql_literal(
],
) -> str:
"""Convert datetime object to a SQL expression string"""
sql = self.db_engine_spec.convert_dttm(self.type, dttm) if self.type else None
dttm_type = self.type or ("DATETIME" if self.is_dttm else None)
sql = self.db_engine_spec.convert_dttm(dttm_type, dttm) if dttm_type else None

if sql:
return sql
Expand Down

0 comments on commit 6bdbd2b

Please sign in to comment.