You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by yo...@apache.org on 2022/10/25 06:41:40 UTC

[superset] branch master updated: fix: time grain key from P0.25Y to P3M (#21919)

This is an automated email from the ASF dual-hosted git repository.

yongjiezhao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git


The following commit(s) were added to refs/heads/master by this push:
     new c6c9215a2b fix: time grain key from P0.25Y to P3M (#21919)
c6c9215a2b is described below

commit c6c9215a2b8651be13151939f7206c78868e2a7c
Author: Yongjie Zhao <yo...@apache.org>
AuthorDate: Tue Oct 25 14:41:30 2022 +0800

    fix: time grain key from P0.25Y to P3M (#21919)
---
 superset/db_engine_specs/duckdb.py   | 2 +-
 superset/db_engine_specs/kusto.py    | 2 +-
 superset/db_engine_specs/teradata.py | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/superset/db_engine_specs/duckdb.py b/superset/db_engine_specs/duckdb.py
index c47282e9b7..577098a1ca 100644
--- a/superset/db_engine_specs/duckdb.py
+++ b/superset/db_engine_specs/duckdb.py
@@ -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})",
     }
 
diff --git a/superset/db_engine_specs/kusto.py b/superset/db_engine_specs/kusto.py
index d8a52768d9..77485310ee 100644
--- a/superset/db_engine_specs/kusto.py
+++ b/superset/db_engine_specs/kusto.py
@@ -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))",
diff --git a/superset/db_engine_specs/teradata.py b/superset/db_engine_specs/teradata.py
index bd2ee51605..887add24e9 100644
--- a/superset/db_engine_specs/teradata.py
+++ b/superset/db_engine_specs/teradata.py
@@ -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')",
     }