Skip to content

Commit

Permalink
Update sqlalchemy example to work with Python 3.8, 3.9 and 3.10 (#2025)
Browse files Browse the repository at this point in the history

Co-authored-by: Ruwann <[email protected]>
  • Loading branch information
ifeLawal and Ruwann authored Jan 11, 2025
1 parent 1844a2f commit 550ba1a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/sqlalchemy/app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import datetime
import logging
from datetime import datetime, timezone

import connexion
import orm
Expand Down Expand Up @@ -29,7 +29,7 @@ def put_pet(pet_id, pet):
p.update(**pet)
else:
logging.info("Creating pet %s..", pet_id)
pet["created"] = datetime.datetime.now(datetime.UTC)
pet["created"] = datetime.now(timezone.utc)
db_session.add(orm.Pet(**pet))
db_session.commit()
return NoContent, (200 if p is not None else 201)
Expand Down

0 comments on commit 550ba1a

Please sign in to comment.