john-bodley commented on code in PR #25239:
URL: https://github.com/apache/superset/pull/25239#discussion_r1323809634
##########
superset/config.py:
##########
@@ -914,6 +914,8 @@ class D3Format(TypedDict, total=False):
[86400, "24 hours"],
]
+CELERY_BEAT_SCHEDULER_EXPIRES = 60 * 60 * 24 * 7 # 1 week
Review Comment:
Could you specify this as a `timedelta(weeks=1)` as it's more readible.
##########
tests/unit_tests/tasks/test_cron_util.py:
##########
@@ -53,34 +56,40 @@ def test_cron_schedule_window_los_angeles(
Reports scheduler: Test cron schedule window for "America/Los_Angeles"
"""
- with freeze_time(current_dttm):
- datetimes = cron_schedule_window(cron, "America/Los_Angeles")
- assert (
- list(cron.strftime("%A, %d %B %Y, %H:%M:%S") for cron in datetimes)
- == expected
- )
+ datetimes = cron_schedule_window(
+ datetime.fromisoformat(current_dttm), cron, "America/Los_Angeles"
+ )
+ assert (
+ list(cron.strftime("%A, %d %B %Y, %H:%M:%S") for cron in datetimes) ==
expected
+ )
@pytest.mark.parametrize(
"current_dttm, cron, expected",
[
- ("2020-01-01T00:59:01Z", "0 1 * * *", []),
Review Comment:
Why are we removing the tests which use the zone designator for the zero UTC
offset?
##########
tests/unit_tests/tasks/test_cron_util.py:
##########
@@ -14,11 +14,9 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
+from datetime import datetime
import pytest
-import pytz
-from dateutil import parser
-from freezegun import freeze_time
Review Comment:
Is this used elsewhere? If not we should remove the `freezegun` library.
--
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]