From 1078c2d3ea708e9989f0bd72e519ea457938bcdc Mon Sep 17 00:00:00 2001 From: Jon Lantsberger Date: Thu, 18 Apr 2024 00:31:43 -0500 Subject: [PATCH] Update context.py (#660) * Update context.py typo in warning, "warm" insteand of "warn" * Update routes.py fixing warn call * Update CHANGES.md * Update CHANGES.md * Update CHANGES.md --------- Co-authored-by: Jonathan Healy --- CHANGES.md | 4 ++++ stac_fastapi/api/stac_fastapi/api/routes.py | 2 +- .../extensions/stac_fastapi/extensions/core/context.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index f043635c0..2cda0a753 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,10 @@ ## [Unreleased] +### Fixed + +* Fixed warnings.warn deprecation syntax for response class and the context extension ([#660](https://github.com/stac-utils/stac-fastapi/pull/660)) + ## [2.5.0] - 2024-04-12 ### Added diff --git a/stac_fastapi/api/stac_fastapi/api/routes.py b/stac_fastapi/api/stac_fastapi/api/routes.py index 66b76d2d7..df4a136eb 100644 --- a/stac_fastapi/api/stac_fastapi/api/routes.py +++ b/stac_fastapi/api/stac_fastapi/api/routes.py @@ -45,7 +45,7 @@ def create_async_endpoint( """ if response_class: - warnings.warns( + warnings.warn( "`response_class` option is deprecated, please set the Response class directly in the endpoint.", # noqa: E501 DeprecationWarning, ) diff --git a/stac_fastapi/extensions/stac_fastapi/extensions/core/context.py b/stac_fastapi/extensions/stac_fastapi/extensions/core/context.py index b65394875..4037ba938 100644 --- a/stac_fastapi/extensions/stac_fastapi/extensions/core/context.py +++ b/stac_fastapi/extensions/stac_fastapi/extensions/core/context.py @@ -28,7 +28,7 @@ class ContextExtension(ApiExtension): def __attrs_post_init__(self): """init.""" - warnings.warm( + warnings.warn( "The ContextExtension is deprecated and will be removed in 3.0.", DeprecationWarning, stacklevel=1,