CoolDude937 commented on PR #36315:
URL: https://github.com/apache/superset/pull/36315#issuecomment-3590902124
viz.py diff_secs issue: Yeah, that diff_secs calculation should be removed,
it does nothing. The diff_delta variable is originally defined before the
if/else block checking what the domain is, like this:
domain = form_data.get("domain_granularity")
diff_delta = rdelta.relativedelta(end, start)
diff_secs = (end - start).total_seconds()
And nowhere else in viz.py. All we are doing is recalculating it within the
month else if block (nowhere else) to enforce the exclusive end date that was
not present beforehand.
Test coverage is lacking: Modified edge case tests of "end date being first
of month" test to check each month in test range and length of array itself.
Added additional tests for leap year, range passed as Date object, and time
range crossing between years.
sanity check on boundary cases:
<img width="915" height="923" alt="image"
src="https://github.com/user-attachments/assets/de2b32de-91d5-444d-9d96-ce72aacfd12a"
/>
Here are sample ranges, March 1st 2021 to March 30th 2021, May 1st 2021, and
May 2nd 2021. All ranges render as intended, excluding the last day as the UI
indicates.
invalid test date issue: Changed January 1st 2025 to February 31st 2025 test
case, to March 1st 2025 to May 1st 2025. Also fixed spelling error.
--
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]