Browse Source
✏️ Fix typos in comments on internal code in `fastapi/concurrency.py` and `fastapi/routing.py` (#9590)
Co-authored-by: Marcelo Trylesinski <[email protected]>
pull/10015/head
ElliottLarsen
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
3 deletions
-
fastapi/concurrency.py
-
fastapi/routing.py
|
|
@ -19,7 +19,7 @@ async def contextmanager_in_threadpool( |
|
|
|
) -> AsyncGenerator[_T, None]: |
|
|
|
# blocking __exit__ from running waiting on a free thread |
|
|
|
# can create race conditions/deadlocks if the context manager itself |
|
|
|
# has it's own internal pool (e.g. a database connection pool) |
|
|
|
# has its own internal pool (e.g. a database connection pool) |
|
|
|
# to avoid this we let __exit__ run without a capacity limit |
|
|
|
# since we're creating a new limiter for each call, any non-zero limit |
|
|
|
# works (1 is arbitrary) |
|
|
|
|
|
@ -83,7 +83,7 @@ def _prepare_response_content( |
|
|
|
if read_with_orm_mode: |
|
|
|
# Let from_orm extract the data from this model instead of converting |
|
|
|
# it now to a dict. |
|
|
|
# Otherwise there's no way to extract lazy data that requires attribute |
|
|
|
# Otherwise, there's no way to extract lazy data that requires attribute |
|
|
|
# access instead of dict iteration, e.g. lazy relationships. |
|
|
|
return res |
|
|
|
return _model_dump( |
|
|
@ -456,7 +456,7 @@ class APIRoute(routing.Route): |
|
|
|
# that doesn't have the hashed_password. But because it's a subclass, it |
|
|
|
# would pass the validation and be returned as is. |
|
|
|
# By being a new field, no inheritance will be passed as is. A new model |
|
|
|
# will be always created. |
|
|
|
# will always be created. |
|
|
|
# TODO: remove when deprecating Pydantic v1 |
|
|
|
self.secure_cloned_response_field: Optional[ |
|
|
|
ModelField |
|
|
|