You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by vi...@apache.org on 2021/09/22 10:35:24 UTC

[superset] 07/17: fix(sqla): support for date adhoc filter (#16634)

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

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

commit d8cae30f8c146811f257a5aa91a51d4d23c21492
Author: Ville Brofeldt <33...@users.noreply.github.com>
AuthorDate: Thu Sep 9 06:41:50 2021 +0300

    fix(sqla): support for date adhoc filter (#16634)
    
    (cherry picked from commit 6465ee7dbd7d1184f2f21f3611cf985cc84aaa6c)
---
 superset/db_engine_specs/base.py   | 6 +++++-
 superset/db_engine_specs/presto.py | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/superset/db_engine_specs/base.py b/superset/db_engine_specs/base.py
index 6461612..2d6e6fa 100644
--- a/superset/db_engine_specs/base.py
+++ b/superset/db_engine_specs/base.py
@@ -252,7 +252,11 @@ class BaseEngineSpec:  # pylint: disable=too-many-public-methods
             types.DateTime(),
             GenericDataType.TEMPORAL,
         ),
-        (re.compile(r"^date", re.IGNORECASE), types.Date(), GenericDataType.TEMPORAL,),
+        (
+            re.compile(r"^date", re.IGNORECASE),
+            types.DateTime(),
+            GenericDataType.TEMPORAL,
+        ),
         (
             re.compile(r"^timestamp", re.IGNORECASE),
             types.TIMESTAMP(),
diff --git a/superset/db_engine_specs/presto.py b/superset/db_engine_specs/presto.py
index d3567e9..e28aa53 100644
--- a/superset/db_engine_specs/presto.py
+++ b/superset/db_engine_specs/presto.py
@@ -508,7 +508,7 @@ class PrestoEngineSpec(BaseEngineSpec):  # pylint: disable=too-many-public-metho
         ),
         (
             re.compile(r"^date.*", re.IGNORECASE),
-            types.DATE(),
+            types.DATETIME(),
             utils.GenericDataType.TEMPORAL,
         ),
         (