datetime.datetime.utcnow() and datetime.datetime.utcfromtimestamp() emit a DeprecationWarning as of Python 3.12 (October 2023). The reason is not style. Both return a naive datetime whose wall-clock value is UTC but whose tzinfo is None, so any later call that assumes naive means local time silently shifts the value by the machine's offset.
The classic failure is datetime.utcnow().timestamp(), which interprets the naive value as local time and produces an epoch that is wrong by the UTC offset. On a UTC server this passes every test and then breaks the moment the code runs somewhere else.
Replace with datetime.datetime.now(datetime.UTC), which is aware and round-trips correctly. datetime.UTC is an alias for datetime.timezone.utc available since 3.11; use the longer spelling if you support 3.10. Find all call sites by running the suite with -W error::DeprecationWarning. Storing aware datetimes end to end is the real fix, since a naive column will re-create the ambiguity later.