bito-code-review[bot] commented on code in PR #42054:
URL: https://github.com/apache/superset/pull/42054#discussion_r3583076664
##########
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:
<div>
<div id="suggestion">
<div id="issue"><b>Incomplete time unit coverage</b></div>
<div id="fix">
The test only covers 4 time units (year, month, day, quarter) but the
implementation supports 8 units. Missing coverage for seconds, minutes, hours,
and weeks could allow regressions in those paths to go undetected.
</div>
</div>
<small><i>Code Review Run #52d6f6</i></small>
</div>
---
Should Bito avoid suggestions like this for future reviews? (<a
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
- [ ] Yes, avoid them
--
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]