bito-code-review[bot] commented on code in PR #42054:
URL: https://github.com/apache/superset/pull/42054#discussion_r3590948084
##########
tests/unit_tests/utils/date_parser_tests.py:
##########
@@ -561,6 +563,18 @@ def test_get_past_or_future() -> None:
assert get_past_or_future("3 month", dttm) == datetime(2020, 5, 29)
+def test_normalize_time_delta() -> None:
+ assert normalize_time_delta("1 year ago") == {"years": -1}
+ assert normalize_time_delta("2 months later") == {"months": 2}
+ assert normalize_time_delta("28 days ago") == {"days": -28}
+ # quarters are converted to months (pd.DateOffset has no quarters argument)
+ assert normalize_time_delta("1 quarter ago") == {"months": -3}
+ assert normalize_time_delta("2 quarters later") == {"months": 6}
Review Comment:
<!-- Bito Reply -->
The suggestion provided by the reviewer was appropriate and helpful. It
correctly identified a gap in test coverage for time units (seconds, minutes,
hours, and weeks) that were supported by the implementation but missing from
the test suite. Addressing this suggestion improves the robustness of the code
by ensuring these paths are covered against future regressions.
--
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]