Update dependency fastapi to v0.108.0 #42
No reviewers
Labels
No Label
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: profitroll/PhotosAPI#42
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "renovate/fastapi-0.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
==0.105.0
->==0.108.0
Release Notes
tiangolo/fastapi (fastapi)
v0.108.0
Compare Source
Upgrades
>=0.29.0,<0.33.0
, update docs and usage of templates with new Starlette arguments. PR #10846 by @tiangolo.v0.107.0
Compare Source
Upgrades
Docs
v0.106.0
Compare Source
Breaking Changes
Using resources from dependencies with
yield
in background tasks is no longer supported.This change is what supports the new features, read below. 🤓
Dependencies with
yield
,HTTPException
and Background TasksDependencies with
yield
now can raiseHTTPException
and other exceptions afteryield
. 🎉Read the new docs here: Dependencies with
yield
andHTTPException
.Before FastAPI 0.106.0, raising exceptions after
yield
was not possible, the exit code in dependencies withyield
was executed after the response was sent, so Exception Handlers would have already run.This was designed this way mainly to allow using the same objects "yielded" by dependencies inside of background tasks, because the exit code would be executed after the background tasks were finished.
Nevertheless, as this would mean waiting for the response to travel through the network while unnecessarily holding a resource in a dependency with yield (for example a database connection), this was changed in FastAPI 0.106.0.
Additionally, a background task is normally an independent set of logic that should be handled separately, with its own resources (e.g. its own database connection).
If you used to rely on this behavior, now you should create the resources for background tasks inside the background task itself, and use internally only data that doesn't depend on the resources of dependencies with
yield
.For example, instead of using the same database session, you would create a new database session inside of the background task, and you would obtain the objects from the database using this new session. And then instead of passing the object from the database as a parameter to the background task function, you would pass the ID of that object and then obtain the object again inside the background task function.
The sequence of execution before FastAPI 0.106.0 was like the diagram in the Release Notes for FastAPI 0.106.0.
The new execution flow can be found in the docs: Execution of dependencies with
yield
.Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.
65adfaf57a
to1f7706f435
Update dependency fastapi to v0.106.0to Update dependency fastapi to v0.107.01f7706f435
toe6c0a53742
Update dependency fastapi to v0.107.0to Update dependency fastapi to v0.108.0