You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by jo...@apache.org on 2021/11/12 18:32:26 UTC

[superset] 01/01: Update date_parser.py

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

johnbodley pushed a commit to branch john-bodley--fix-date-parse
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 8e5b0ea5d5cadebe7e6ecf5d20fcc62e9be0ccac
Author: John Bodley <45...@users.noreply.github.com>
AuthorDate: Fri Nov 12 10:31:00 2021 -0800

    Update date_parser.py
---
 superset/utils/date_parser.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/superset/utils/date_parser.py b/superset/utils/date_parser.py
index a72d49f..76a1369 100644
--- a/superset/utils/date_parser.py
+++ b/superset/utils/date_parser.py
@@ -324,7 +324,9 @@ class EvalDateTruncFunc:  # pylint: disable=too-few-public-methods
                 month=1, day=1, hour=0, minute=0, second=0, microsecond=0
             )
         if unit == "quarter":
-            dttm = pd.Period(pd.Timestamp(dttm), freq="Q").to_timestamp()
+            dttm = (
+                pd.Period(pd.Timestamp(dttm), freq="Q").to_timestamp().to_pydatetime()
+            )
         elif unit == "month":
             dttm = dttm.replace(day=1, hour=0, minute=0, second=0, microsecond=0)
         elif unit == "week":