chore: bump minimum supported Python version to 3.11 (#10386)

This commit is contained in:
Bowen Liang
2024-11-24 13:28:46 +08:00
committed by GitHub
parent 0181f1c08c
commit 6c8e208ef3
81 changed files with 271 additions and 300 deletions

View File

@@ -1,4 +1,4 @@
from datetime import datetime, timezone
from datetime import UTC, datetime
from celery import states
@@ -16,8 +16,8 @@ class CeleryTask(db.Model):
result = db.Column(db.PickleType, nullable=True)
date_done = db.Column(
db.DateTime,
default=lambda: datetime.now(timezone.utc).replace(tzinfo=None),
onupdate=lambda: datetime.now(timezone.utc).replace(tzinfo=None),
default=lambda: datetime.now(UTC).replace(tzinfo=None),
onupdate=lambda: datetime.now(UTC).replace(tzinfo=None),
nullable=True,
)
traceback = db.Column(db.Text, nullable=True)
@@ -37,4 +37,4 @@ class CeleryTaskSet(db.Model):
id = db.Column(db.Integer, db.Sequence("taskset_id_sequence"), autoincrement=True, primary_key=True)
taskset_id = db.Column(db.String(155), unique=True)
result = db.Column(db.PickleType, nullable=True)
date_done = db.Column(db.DateTime, default=lambda: datetime.now(timezone.utc).replace(tzinfo=None), nullable=True)
date_done = db.Column(db.DateTime, default=lambda: datetime.now(UTC).replace(tzinfo=None), nullable=True)