Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sqlalchemy example to work with Python 3.8, 3.9 and 3.10 #2025

Merged
merged 4 commits into from
Jan 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Ruwann marked this conversation as resolved.
Show resolved Hide resolved
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
Loading