eschutho commented on a change in pull request #17338:
URL: https://github.com/apache/superset/pull/17338#discussion_r747773517
##########
File path: superset/tasks/cron_util.py
##########
@@ -28,8 +28,12 @@ def cron_schedule_window(cron: str, timezone: str) ->
Iterator[datetime]:
window_size = app.config["ALERT_REPORTS_CRON_WINDOW_SIZE"]
# create a time-aware datetime in utc
time_now = datetime.now(tz=dt_timezone.utc)
- tz = pytz.timezone(timezone)
- utc = pytz.timezone("UTC")
+ try:
+ tz = pytz_timezone(timezone)
+ except UnknownTimeZoneError:
+ # fallback to default timezone
+ tz = pytz_timezone("UTC")
Review comment:
good idea!
--
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]