aminghadersohi commented on code in PR #45671:
URL: https://github.com/apache/superset/pull/45671#discussion_r4362776864


##########
superset/utils/date_parser.py:
##########
@@ -846,8 +845,13 @@ def eval(self) -> datetime:
                 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().to_pydatetime()
+            dttm = dttm.replace(
+                month=3 * ((dttm.month - 1) // 3) + 1,
+                day=1,
+                hour=0,
+                minute=0,
+                second=0,
+                microsecond=0,
             )

Review Comment:
   With dataset timezone `Europe/Berlin`, 
`DATETRUNC(DATETIME('2024-05-31T12:34:56+08:00'), QUARTER)` should yield UTC 
`2024-03-31 16:00`; `get_time_filter` instead emits SQL bound `2024-03-31 
22:00`, six hours late.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to