aminghadersohi commented on code in PR #45671:
URL: https://github.com/apache/superset/pull/45671#discussion_r4375960373
##########
superset/utils/date_parser.py:
##########
@@ -763,8 +777,10 @@ def get_since_until( # pylint:
disable=too-many-arguments,too-many-locals,too-m
_since, _until = map(datetime_eval, since_and_until)
- if _since and _until and _since > _until:
- raise ValueError(_("From date cannot be larger than to date"))
+ if _since and _until:
+ since_comparison, until_comparison = _get_comparable_bounds(_since,
_until)
Review Comment:
A dashboard range `DATETRUNC(DATETIME('2024-05-31T12:00:00+08:00'), QUARTER)
: now` now parses, but intersecting it with `2024-05-01 : 2024-06-01` in MCP's
`intersect_time_ranges` raises `TypeError` in `max()`. This previously returned
the narrower range.
##########
superset/utils/date_parser.py:
##########
@@ -846,8 +862,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(
Review Comment:
Without a dataset timezone, an aware quarter bound bypasses UTC conversion:
SQLite emits `ts >= '2024-04-01 00:00:00+08:00'`, excluding a TEXT timestamp at
`2024-04-01 00:00:00` that the old quarter bound included.
--
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]