mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix(mssql): week time grain should respect datefirst setting (#10811)
* "P1W" grain should respect DATEFIRST setting in MS SQL Server * Added "week_start_sunday" and "week_start_monday" grains support. Adjusted the "week" grain for better backward compatibility with MS SQL 2005/2008. * Stylistic and linter-requested changes * fix test Co-authored-by: Valeriy Aleksashkin <v.aleksashkin@gmail.com> Co-authored-by: Ville Brofeldt <ville.v.brofeldt@gmail.com>
This commit is contained in:
@@ -79,7 +79,7 @@ class TestMssqlEngineSpec(TestDbEngineSpec):
|
||||
col = column("MixedCase")
|
||||
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)")
|
||||
self.assertEqual(result, "DATEADD(YEAR, DATEDIFF(YEAR, 0, [MixedCase]), 0)")
|
||||
|
||||
def test_convert_dttm(self):
|
||||
dttm = self.get_dttm()
|
||||
|
||||
Reference in New Issue
Block a user