Skip to content

Commit ffca51b

Browse files
Merge branch 'main' into CAT-1522
2 parents ee84284 + 504bc6a commit ffca51b

File tree

12 files changed

+74
-13
lines changed

12 files changed

+74
-13
lines changed

CHANGELOG.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1010
### Added
1111

1212
- Added environment variables `HIDE_PRIVATE_DATA` and `PRIVATE_DATA_FIELD` to control visibility of private technical data fields in SFEOS responses. [#518](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/518)
13+
- Added validator for `REDIS_MAX_CONNECTIONS` to handle empty or null-like values ("", "null", None) and return None instead. [#519](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/519)
1314

1415
### Changed
1516

@@ -21,6 +22,18 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
2122

2223
### Updated
2324

25+
## [v6.7.2] - 2025-11-04
26+
27+
### Fixed
28+
29+
- Fixed "list index out of range" error when using BETWEEN operator in CQL2-text filters. [#521](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/521)
30+
31+
## [v6.7.1] - 2025-10-31
32+
33+
### Fixed
34+
35+
- Ensure `REDIS_MAX_CONNECTION` can accept `None` and integer value for default number of connection. [#515](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/515)
36+
2437
## [v6.7.0] - 2025-10-27
2538

2639
### Added
@@ -613,7 +626,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
613626
- Use genexp in execute_search and get_all_collections to return results.
614627
- Added db_to_stac serializer to item_collection method in core.py.
615628

616-
[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.7.0...main
629+
[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.7.2...main
630+
[v6.7.2]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.7.1...v6.7.2
631+
[v6.7.1]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.7.0...v6.7.1
617632
[v6.7.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.6.0...v6.7.0
618633
[v6.6.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.5.1...v6.6.0
619634
[v6.5.1]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.5.0...v6.5.1

stac_fastapi/core/stac_fastapi/core/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ async def post_search(
830830
search = await self.database.apply_cql2_filter(search, cql2_filter)
831831
except Exception as e:
832832
raise HTTPException(
833-
status_code=400, detail=f"Error with cql2_json filter: {e}"
833+
status_code=400, detail=f"Error with cql2 filter: {e}"
834834
)
835835

836836
if hasattr(search_request, "q"):

stac_fastapi/core/stac_fastapi/core/redis_utils.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ def validate_db_sentinel(cls, v: int) -> int:
3636
raise ValueError("REDIS_DB must be a positive integer")
3737
return v
3838

39+
@field_validator("REDIS_MAX_CONNECTIONS", mode="before")
40+
@classmethod
41+
def validate_max_connections(cls, v):
42+
"""Handle empty/None values for REDIS_MAX_CONNECTIONS."""
43+
if v in ["", "null", "Null", "NULL", "none", "None", "NONE", None]:
44+
return None
45+
return v
46+
3947
@field_validator("REDIS_SELF_LINK_TTL")
4048
@classmethod
4149
def validate_self_link_ttl_sentinel(cls, v: int) -> int:
@@ -118,6 +126,14 @@ def validate_db_standalone(cls, v: int) -> int:
118126
raise ValueError("REDIS_DB must be a positive integer")
119127
return v
120128

129+
@field_validator("REDIS_MAX_CONNECTIONS", mode="before")
130+
@classmethod
131+
def validate_max_connections(cls, v):
132+
"""Handle empty/None values for REDIS_MAX_CONNECTIONS."""
133+
if v in ["", "null", "Null", "NULL", "none", "None", "NONE", None]:
134+
return None
135+
return v
136+
121137
@field_validator("REDIS_SELF_LINK_TTL")
122138
@classmethod
123139
def validate_self_link_ttl_standalone(cls, v: int) -> int:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""library version."""
2-
__version__ = "6.7.0"
2+
__version__ = "6.7.2"

stac_fastapi/elasticsearch/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ keywords = [
3030
]
3131
dynamic = ["version"]
3232
dependencies = [
33-
"stac-fastapi-core==6.7.0",
34-
"sfeos-helpers==6.7.0",
33+
"stac-fastapi-core==6.7.2",
34+
"sfeos-helpers==6.7.2",
3535
"elasticsearch[async]~=8.19.1",
3636
"uvicorn~=0.23.0",
3737
"starlette>=0.35.0,<0.36.0",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""library version."""
2-
__version__ = "6.7.0"
2+
__version__ = "6.7.2"

stac_fastapi/opensearch/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ keywords = [
3030
]
3131
dynamic = ["version"]
3232
dependencies = [
33-
"stac-fastapi-core==6.7.0",
34-
"sfeos-helpers==6.7.0",
33+
"stac-fastapi-core==6.7.2",
34+
"sfeos-helpers==6.7.2",
3535
"opensearch-py~=2.8.0",
3636
"opensearch-py[async]~=2.8.0",
3737
"uvicorn~=0.23.0",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""library version."""
2-
__version__ = "6.7.0"
2+
__version__ = "6.7.2"

stac_fastapi/sfeos_helpers/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ keywords = [
3131
]
3232
dynamic = ["version"]
3333
dependencies = [
34-
"stac-fastapi.core==6.7.0",
34+
"stac-fastapi.core==6.7.2",
3535
]
3636

3737
[project.urls]

stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/filter/transform.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,19 @@ def to_es(queryables_mapping: Dict[str, Any], query: Dict[str, Any]) -> Dict[str
9292

9393
elif query["op"] == AdvancedComparisonOp.BETWEEN:
9494
field = to_es_field(queryables_mapping, query["args"][0]["property"])
95-
gte, lte = query["args"][1], query["args"][2]
95+
96+
# Handle both formats: [property, [lower, upper]] or [property, lower, upper]
97+
if len(query["args"]) == 2 and isinstance(query["args"][1], list):
98+
# Format: [{'property': '...'}, [lower, upper]]
99+
gte, lte = query["args"][1][0], query["args"][1][1]
100+
elif len(query["args"]) == 3:
101+
# Format: [{'property': '...'}, lower, upper]
102+
gte, lte = query["args"][1], query["args"][2]
103+
else:
104+
raise ValueError(
105+
f"BETWEEN operator expects 2 or 3 args, got {len(query['args'])}"
106+
)
107+
96108
if isinstance(gte, dict) and "timestamp" in gte:
97109
gte = gte["timestamp"]
98110
if isinstance(lte, dict) and "timestamp" in lte:

0 commit comments

Comments
 (0)