From 9e9fd443264f9ef0a5a471ccbcce70dc4029f62d Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Thu, 4 Dec 2025 00:16:29 +0800 Subject: [PATCH 1/2] make redis imports optional --- CHANGELOG.md | 1 + stac_fastapi/core/stac_fastapi/core/core.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a0d1a0c..02744857 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix incorrect min/max date formatting in `apply_datetime_filter` for `POST` requests. [#539](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/539) - Fixed datetime filtering for .0Z milliseconds to preserve precision in apply_filter_datetime, ensuring only items exactly within the specified range are returned. [#535](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/535) - Normalize datetime in POST /search requests to match GET /search behavior. [#543](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/543) +- Fix optional Redis support in core.py. [#544](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/544) ### Removed diff --git a/stac_fastapi/core/stac_fastapi/core/core.py b/stac_fastapi/core/stac_fastapi/core/core.py index 3334a4db..92f7aa0e 100644 --- a/stac_fastapi/core/stac_fastapi/core/core.py +++ b/stac_fastapi/core/stac_fastapi/core/core.py @@ -24,7 +24,6 @@ from stac_fastapi.core.base_settings import ApiBaseSettings from stac_fastapi.core.datetime_utils import format_datetime_range from stac_fastapi.core.models.links import PagingLinks -from stac_fastapi.core.redis_utils import redis_pagination_links from stac_fastapi.core.serializers import CollectionSerializer, ItemSerializer from stac_fastapi.core.session import Session from stac_fastapi.core.utilities import filter_fields, get_bool_env @@ -426,6 +425,8 @@ async def all_collections( ] if redis_enable: + from stac_fastapi.core.redis_utils import redis_pagination_links + await redis_pagination_links( current_url=str(request.url), token=token, @@ -904,6 +905,8 @@ async def post_search( links.extend(collection_links) if redis_enable: + from stac_fastapi.core.redis_utils import redis_pagination_links + await redis_pagination_links( current_url=str(request.url), token=token_param, From 7c5540cefea8bb45b0979ebc226d372cfb7ea310 Mon Sep 17 00:00:00 2001 From: jonhealy1 Date: Thu, 4 Dec 2025 00:19:50 +0800 Subject: [PATCH 2/2] update pr number --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 02744857..0864e0a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix incorrect min/max date formatting in `apply_datetime_filter` for `POST` requests. [#539](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/539) - Fixed datetime filtering for .0Z milliseconds to preserve precision in apply_filter_datetime, ensuring only items exactly within the specified range are returned. [#535](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/535) - Normalize datetime in POST /search requests to match GET /search behavior. [#543](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/543) -- Fix optional Redis support in core.py. [#544](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/544) +- Fix optional Redis support in core.py. [#549](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/549) ### Removed