codeant-ai-for-open-source[bot] commented on code in PR #41527:
URL: https://github.com/apache/superset/pull/41527#discussion_r3490193144
##########
tests/unit_tests/utils/date_parser_tests.py:
##########
@@ -760,3 +760,27 @@ def
test_datetime_eval_does_not_emit_parsedatetime_debug_logs(
"flood production logs. Records: "
+ repr([(r.levelname, r.getMessage()) for r in parsedatetime_records])
)
+
+
+@patch("superset.utils.date_parser.parse_human_datetime",
mock_parse_human_datetime)
+def test_get_since_until_sub_hour_presets() -> None:
+ """Verify that sub-hour presets ('Last 5 minutes', 'Last 15 minutes',
+ 'Last 30 minutes', 'Last 1 hour') resolve to the expected datetime pairs
+ when relative_end='now'."""
+ result: tuple
+
+ result = get_since_until("Last 5 minutes", relative_end="now")
+ expected = datetime(2016, 11, 7, 9, 25, 10), datetime(2016, 11, 7, 9, 30,
10)
Review Comment:
**Suggestion:** Add a type annotation for this repeatedly reused local
variable to keep the new test aligned with the type-hinted pattern used in
nearby tests. [custom_rule]
**Severity Level:** Minor ⚠️
<details>
<summary><b>Why it matters? 🤔 </b></summary>
This new local variable is assigned without any type annotation, and the
custom rule requires type hints on relevant variables that can be annotated.
The suggestion correctly identifies a real violation.
</details>
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=abae30f5d6324fc7b8c8acda8e05bc8b&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=abae30f5d6324fc7b8c8acda8e05bc8b&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
*(Use Cmd/Ctrl + Click for best experience)*
<details>
<summary><b>Prompt for AI Agent 🤖 </b></summary>
```mdx
This is a comment left during a code review.
**Path:** tests/unit_tests/utils/date_parser_tests.py
**Line:** 773:773
**Comment:**
*Custom Rule: Add a type annotation for this repeatedly reused local
variable to keep the new test aligned with the type-hinted pattern used in
nearby tests.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41527&comment_hash=24b6d92e83f1cf5fb17460cc6d43331ce0cd8041fd0114b008f27971cbac9e16&reaction=like'>👍</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F41527&comment_hash=24b6d92e83f1cf5fb17460cc6d43331ce0cd8041fd0114b008f27971cbac9e16&reaction=dislike'>👎</a>
--
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]