-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Labels
api: datastoreIssues related to the googleapis/python-ndb API.Issues related to the googleapis/python-ndb API.
Description
_now staticmethod, used by auto_now_add, is using datetime.datetime.utcnow(), which is deprecated.
Environment details
- API: python-ndb
- 2020 MacOSX; Sonama 14.5
- Python 3.12.4
- google-cloud-ndb version: 2.16.0
Steps to reproduce
- Add
auto_now_addto aDateTimePropertymodel.
Code example
time_stamp_field = ndb.DateTimeProperty(tzinfo=datetime.timezone.utc, auto_now_add=True)Stack trace
DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
snarfed
Metadata
Metadata
Assignees
Labels
api: datastoreIssues related to the googleapis/python-ndb API.Issues related to the googleapis/python-ndb API.