Twiink commented on code in PR #45671:
URL: https://github.com/apache/superset/pull/45671#discussion_r4366126478
##########
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:
Thanks for the concrete example. Fixed in 45b0f5b: get_time_filter now
preserves explicit offsets when converting bounds to UTC and applies the
dataset timezone only to naive bounds. Your +08:00 quarter example now produces
2024-03-31 16:00:00 UTC with Europe/Berlin. Added regression coverage through
range parsing and SQL filter generation, including mixed bounds.
--
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]