bito-code-review[bot] commented on code in PR #37014: URL: https://github.com/apache/superset/pull/37014#discussion_r3408454080
########## superset/utils/core.py: ########## @@ -65,6 +65,7 @@ import markdown as md import nh3 import pandas as pd +import pytz Review Comment: <div> <div id="suggestion"> <div id="issue"><b>Use zoneinfo instead of pytz</b></div> <div id="fix"> Since Superset targets Python ≥3.10, replace the third-party `pytz` import with `from zoneinfo import ZoneInfo, ZoneInfoNotFoundError`, use `ZoneInfo(_col.timezone)` instead of `pytz.timezone`, and catch `ZoneInfoNotFoundError` rather than `pytz.UnknownTimeZoneError`. </div> </div> <small><i>Code Review Run #5607e8</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 ########## superset/viz.py: ########## @@ -324,6 +324,7 @@ def get_df(self, query_obj: QueryObjectDict | None = None) -> pd.DataFrame: timestamp_format=timestamp_format, offset=self.datasource.offset, time_shift=self.form_data.get("time_shift"), + timezone=self.datasource.get_dataset_timezone(), Review Comment: <div> <div id="suggestion"> <div id="issue"><b>Missing test for timezone feature</b></div> <div id="fix"> The added `timezone` parameter introduces behavioral change (UTC-to-dataset-timezone conversion) without corresponding unit test coverage. Existing `test_get_df_handles_dttm_col` mocks `offset` but not `get_dataset_timezone()`, so timezone scenarios will fall through without validation. Per BITO.md adaptive rule [11730], new functionality should have dedicated tests covering success paths and edge cases. </div> </div> <small><i>Code Review Run #5607e8</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]
