villebro commented on code in PR #25239:
URL: https://github.com/apache/superset/pull/25239#discussion_r1329452625


##########
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:
   I *love* freezegun, hands off @john-bodley! 😄 



##########
superset/tasks/scheduler.py:
##########
@@ -47,9 +48,15 @@ def scheduler() -> None:
         return
     with session_scope(nullpool=True) as session:
         active_schedules = ReportScheduleDAO.find_active(session)
+        triggered_at = (
+            datetime.fromisoformat(scheduler.request.expires)
+            - app.config["CELERY_BEAT_SCHEDULER_EXPIRES"]

Review Comment:
   not your fault, but having to do it like this just makes me cringe.. 😄 I'm 
hoping someone can add `request.scheduled_at` to Celery 😉 



##########
superset/tasks/scheduler.py:
##########
@@ -47,9 +48,15 @@ def scheduler() -> None:
         return
     with session_scope(nullpool=True) as session:
         active_schedules = ReportScheduleDAO.find_active(session)
+        triggered_at = (
+            datetime.fromisoformat(scheduler.request.expires)
+            - app.config["CELERY_BEAT_SCHEDULER_EXPIRES"]

Review Comment:
   not your fault, but having to do it like this just makes me cringe.. 😄 I'm 
hoping someone can add `request.scheduled_at` to Celery 😉 



##########
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:
   I *love* freezegun, hands off @john-bodley! 😄 



-- 
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]

Reply via email to