Skip to content

Commit

Permalink
fix: time grain key from P0.25Y to P3M (#21919)
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyongjie authored Oct 25, 2022
1 parent 76c865f commit c6c9215
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion superset/db_engine_specs/duckdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class DuckDBEngineSpec(BaseEngineSpec):
"P1D": "DATE_TRUNC('day', {col})",
"P1W": "DATE_TRUNC('week', {col})",
"P1M": "DATE_TRUNC('month', {col})",
"P0.25Y": "DATE_TRUNC('quarter', {col})",
"P3M": "DATE_TRUNC('quarter', {col})",
"P1Y": "DATE_TRUNC('year', {col})",
}

Expand Down
2 changes: 1 addition & 1 deletion superset/db_engine_specs/kusto.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class KustoSqlEngineSpec(BaseEngineSpec): # pylint: disable=abstract-method
"P1D": "DATEADD(day, DATEDIFF(day, 0, {col}), 0)",
"P1W": "DATEADD(day, -1, DATEADD(week, DATEDIFF(week, 0, {col}), 0))",
"P1M": "DATEADD(month, DATEDIFF(month, 0, {col}), 0)",
"P0.25Y": "DATEADD(quarter, DATEDIFF(quarter, 0, {col}), 0)",
"P3M": "DATEADD(quarter, DATEDIFF(quarter, 0, {col}), 0)",
"P1Y": "DATEADD(year, DATEDIFF(year, 0, {col}), 0)",
"1969-12-28T00:00:00Z/P1W": "DATEADD(day, -1,"
" DATEADD(week, DATEDIFF(week, 0, {col}), 0))",
Expand Down
2 changes: 1 addition & 1 deletion superset/db_engine_specs/teradata.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TeradataEngineSpec(BaseEngineSpec):
"P1D": "TRUNC(CAST({col} as DATE), 'DDD')",
"P1W": "TRUNC(CAST({col} as DATE), 'WW')",
"P1M": "TRUNC(CAST({col} as DATE), 'MONTH')",
"P0.25Y": "TRUNC(CAST({col} as DATE), 'Q')",
"P3M": "TRUNC(CAST({col} as DATE), 'Q')",
"P1Y": "TRUNC(CAST({col} as DATE), 'YEAR')",
}

Expand Down

0 comments on commit c6c9215

Please sign in to comment.