mirror of https://github.com/apache/superset.git
db_engine_specs: use correct sqlite week time grain (#4831)
We want the week of year %W and not the day of week %w when using week as time grain. Reference: https://www.sqlite.org/lang_datefunc.html
This commit is contained in:
parent
23a3365cd1
commit
3b18fbf9e3
|
@ -424,7 +424,7 @@ class SqliteEngineSpec(BaseEngineSpec):
|
|||
'PT1H'),
|
||||
Grain('day', _('day'), 'DATE({col})', 'P1D'),
|
||||
Grain('week', _('week'),
|
||||
"DATE({col}, -strftime('%w', {col}) || ' days')",
|
||||
"DATE({col}, -strftime('%W', {col}) || ' days')",
|
||||
'P1W'),
|
||||
Grain('month', _('month'),
|
||||
"DATE({col}, -strftime('%d', {col}) || ' days', '+1 day')",
|
||||
|
|
Loading…
Reference in New Issue