Skip to content

datetime.datetime.utc is deprecated in python 3.12 #436

Open
@chrisroat

Description

@chrisroat

The following line gives an error:

created_at = Column(DateTime, default=datetime.utcnow, nullable=False)

When this was originally written, was there a reason to pass a python function instead of sqlalchemy func, like the following?

from sqlalchemy.sql import func
...
created_at = Column(DateTime, default=func.now(), nullable=False) 

(or even using server_default instead, but that requires a schema change to implement now)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions