bito-code-review[bot] commented on code in PR #41424:
URL: https://github.com/apache/superset/pull/41424#discussion_r3492584520
##########
tests/unit_tests/commands/report/execute_test.py:
##########
@@ -1190,6 +1191,22 @@ def
test_update_query_context_wraps_screenshot_failure(mocker: MockerFixture) ->
state._update_query_context()
+def test_update_query_context_wraps_screenshot_failure_xlsx(
+ mocker: MockerFixture,
+) -> None:
+ """_update_query_context surfaces the caller's error class (XLSX, not
CSV)."""
+ schedule = mocker.Mock(spec=ReportSchedule)
+ state = BaseReportState(schedule, datetime.utcnow(), uuid4())
Review Comment:
<!-- Bito Reply -->
The suggestion to replace `datetime.utcnow()` with
`datetime.now(timezone.utc)` is correct. `datetime.utcnow()` is deprecated in
Python 3.12+ and returns a naive datetime object, whereas
`datetime.now(timezone.utc)` returns an aware datetime object, which is the
recommended best practice for handling timezones in modern Python.
**tests/unit_tests/commands/report/execute_test.py**
```
schedule = mocker.Mock(spec=ReportSchedule)
state = BaseReportState(schedule, datetime.now(timezone.utc), uuid4())
```
--
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]