villebro commented on a change in pull request #8464: [SIP-15] Fixing datetime
conversion and SQL literal
URL:
https://github.com/apache/incubator-superset/pull/8464#discussion_r339897079
##########
File path: tests/db_engine_specs/mssql_tests.py
##########
@@ -69,3 +69,12 @@ def test_time_exp_mixd_case_col_1y(self):
expr = MssqlEngineSpec.get_timestamp_expr(col, None, "P1Y")
result = str(expr.compile(None, dialect=mssql.dialect()))
self.assertEqual(result, "DATEADD(year, DATEDIFF(year, 0,
[MixedCase]), 0)")
+
+ def test_convert_dttm(self):
+ dttm = self.get_dttm()
+
+ for target_type in ("DATE", "DATETIME", "SMALLDATETIME", "TIMESTAMP"):
+ self.assertEqual(
+ MssqlEngineSpec.convert_dttm(target_type, dttm),
+ "CONVERT(DATETIME, '2019-01-02T03:04:05.678900', 126)",
+ )
Review comment:
..and the test here.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]