Skip to content

Commit 67df17b

Browse files
authored
Enable direct response, stac-fastapi 5.2.0, deprecation warnings (#359)
**Related Issue(s):** - #347 **Description:** #### v4.0.0a2 release #### Added - Added support for high-performance direct response mode for both Elasticsearch and Opensearch backends, controlled by the `ENABLE_DIRECT_RESPONSE` environment variable. When enabled (`ENABLE_DIRECT_RESPONSE=true`), endpoints return Starlette Response objects directly, bypassing FastAPI's jsonable_encoder and Pydantic serialization for significantly improved performance on large search responses. **Note:** In this mode, all FastAPI dependencies (including authentication, custom status codes, and validation) are disabled for all routes. Default is `false` for safety. A warning is logged at startup if enabled. See [issue #347](#347) #### Changed - Updated test suite to use `httpx.ASGITransport(app=...)` for FastAPI app testing (removes deprecation warning). - Updated stac-fastapi parent libraries to 5.2.0. - Migrated Elasticsearch index template creation from legacy `put_template` to composable `put_index_template` API in `database_logic.py`. This resolves deprecation warnings and ensures compatibility with Elasticsearch 7.x and 8.x. - Updated all Pydantic models to use `ConfigDict` instead of class-based `Config` for Pydantic v2 compatibility. This resolves deprecation warnings and prepares for Pydantic v3. - Migrated all Pydantic `@root_validator` validators to `@model_validator` for Pydantic v2 compatibility. - Migrated startup event handling from deprecated `@app.on_event("startup")` to FastAPI's recommended lifespan context manager. This removes deprecation warnings and ensures compatibility with future FastAPI versions. **PR Checklist:** - [x] Code is formatted and linted (run `pre-commit run --all-files`) - [x] Tests pass (run `make test`) - [x] Documentation has been updated to reflect changes, if applicable - [x] Changes are added to the changelog
1 parent 5f91e50 commit 67df17b

File tree

25 files changed

+277
-117
lines changed

25 files changed

+277
-117
lines changed

CHANGELOG.md

+41-22
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,24 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1111

1212
### Changed
1313

14+
### Fixed
15+
16+
## [v4.0.0a2] - 2025-04-20
17+
18+
### Added
19+
- Added support for high-performance direct response mode for both Elasticsearch and Opensearch backends, controlled by the `ENABLE_DIRECT_RESPONSE` environment variable. When enabled (`ENABLE_DIRECT_RESPONSE=true`), endpoints return Starlette Response objects directly, bypassing FastAPI's jsonable_encoder and Pydantic serialization for significantly improved performance on large search responses. **Note:** In this mode, all FastAPI dependencies (including authentication, custom status codes, and validation) are disabled for all routes. Default is `false` for safety. A warning is logged at startup if enabled. See [issue #347](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/issues/347) and [PR #359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359).
20+
- Added robust tests for the `ENABLE_DIRECT_RESPONSE` environment variable, covering both Elasticsearch and OpenSearch backends. Tests gracefully handle missing backends by attempting to import both configs and skipping if neither is available. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
21+
22+
### Changed
23+
- Updated test suite to use `httpx.ASGITransport(app=...)` for FastAPI app testing (removes deprecation warning). [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
24+
- Updated stac-fastapi parent libraries to 5.2.0. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
25+
- Migrated Elasticsearch index template creation from legacy `put_template` to composable `put_index_template` API in `database_logic.py`. This resolves deprecation warnings and ensures compatibility with Elasticsearch 7.x and 8.x. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
26+
- Updated all Pydantic models to use `ConfigDict` instead of class-based `Config` for Pydantic v2 compatibility. This resolves deprecation warnings and prepares for Pydantic v3. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
27+
- Migrated all Pydantic `@root_validator` validators to `@model_validator` for Pydantic v2 compatibility. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
28+
- Migrated startup event handling from deprecated `@app.on_event("startup")` to FastAPI's recommended lifespan context manager. This removes deprecation warnings and ensures compatibility with future FastAPI versions. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
29+
- Refactored all boolean environment variable parsing in both Elasticsearch and OpenSearch backends to use the shared `get_bool_env` utility. This ensures robust and consistent handling of environment variables such as `ES_USE_SSL`, `ES_HTTP_COMPRESS`, and `ES_VERIFY_CERTS` across both backends. [#359](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/359)
30+
31+
1432
### Fixed
1533

1634
## [v4.0.0a1] - 2925-04-17
@@ -343,25 +361,26 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
343361
- Use genexp in execute_search and get_all_collections to return results.
344362
- Added db_to_stac serializer to item_collection method in core.py.
345363

346-
[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v4.0.0a1...main
347-
[v4.0.0a1]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v4.0.0a0...v4.0.0a1
348-
[v4.0.0a0]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v3.2.5...v4.0.0a0
349-
[v3.2.5]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v3.2.4...v3.2.5
350-
[v3.2.4]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v3.2.3...v3.2.4
351-
[v3.2.3]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v3.2.2...v3.2.3
352-
[v3.2.2]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v3.2.1...v3.2.2
353-
[v3.2.1]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v3.2.0...v3.2.1
354-
[v3.2.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v3.1.0...v3.2.0
355-
[v3.1.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v3.0.0...v3.1.0
356-
[v3.0.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v2.4.1...v3.0.0
357-
[v2.4.1]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v2.4.0...v2.4.1
358-
[v2.4.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v2.3.0...v2.4.0
359-
[v2.3.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v2.2.0...v2.3.0
360-
[v2.2.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v2.1.0...v2.2.0
361-
[v2.1.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v2.0.0...v2.1.0
362-
[v2.0.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v1.1.0...v2.0.0
363-
[v1.1.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v1.0.0...v1.1.0
364-
[v1.0.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v0.3.0...v1.0.0
365-
[v0.3.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v0.2.0...v0.3.0
366-
[v0.2.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v0.1.0...v0.2.0
367-
[v0.1.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch/tree/v0.1.0
364+
[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v4.0.0a2...main
365+
[v4.0.0a2]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v4.0.0a1...v4.0.0a2
366+
[v4.0.0a1]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v4.0.0a0...v4.0.0a1
367+
[v4.0.0a0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v3.2.5...v4.0.0a0
368+
[v3.2.5]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v3.2.4...v3.2.5
369+
[v3.2.4]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v3.2.3...v3.2.4
370+
[v3.2.3]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v3.2.2...v3.2.3
371+
[v3.2.2]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v3.2.1...v3.2.2
372+
[v3.2.1]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v3.2.0...v3.2.1
373+
[v3.2.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v3.1.0...v3.2.0
374+
[v3.1.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v3.0.0...v3.1.0
375+
[v3.0.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v2.4.1...v3.0.0
376+
[v2.4.1]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v2.4.0...v2.4.1
377+
[v2.4.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v2.3.0...v2.4.0
378+
[v2.3.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v2.2.0...v2.3.0
379+
[v2.2.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v2.1.0...v2.2.0
380+
[v2.1.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v2.0.0...v2.1.0
381+
[v2.0.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v1.1.0...v2.0.0
382+
[v1.1.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v1.0.0...v1.1.0
383+
[v1.0.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v0.3.0...v1.0.0
384+
[v0.3.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v0.2.0...v0.3.0
385+
[v0.2.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v0.1.0...v0.2.0
386+
[v0.1.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v0.1.0

README.md

+18-6
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,18 @@
2929
- There is [Postman](https://documenter.getpostman.com/view/12888943/2s8ZDSdRHA) documentation here for examples on how to run some of the API routes locally - after starting the elasticsearch backend via the compose.yml file.
3030
- The `/examples` folder shows an example of running stac-fastapi-elasticsearch from PyPI in docker without needing any code from the repository. There is also a Postman collection here that you can load into Postman for testing the API routes.
3131

32-
- For changes, see the [Changelog](CHANGELOG.md)
33-
- We are always welcoming contributions. For the development notes: [Contributing](CONTRIBUTING.md)
32+
33+
### Performance Note
34+
35+
The `enable_direct_response` option is provided by the stac-fastapi core library (introduced in stac-fastapi 5.2.0) and is available in this project starting from v4.0.0.
36+
37+
**You can now control this setting via the `ENABLE_DIRECT_RESPONSE` environment variable.**
38+
39+
When enabled (`ENABLE_DIRECT_RESPONSE=true`), endpoints return Starlette Response objects directly, bypassing FastAPI's default serialization for improved performance. **However, all FastAPI dependencies (including authentication, custom status codes, and validation) are disabled for all routes.**
40+
41+
This mode is best suited for public or read-only APIs where authentication and custom logic are not required. Default is `false` for safety.
42+
43+
See: [issue #347](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/issues/347)
3444

3545

3646
### To install from PyPI:
@@ -74,8 +84,9 @@ If you wish to use a different version, put the following in a
7484
file named `.env` in the same directory you run Docker Compose from:
7585

7686
```shell
77-
ELASTICSEARCH_VERSION=7.17.1
78-
OPENSEARCH_VERSION=2.11.0
87+
ELASTICSEARCH_VERSION=8.11.0
88+
OPENSEARCH_VERSION=2.11.1
89+
ENABLE_DIRECT_RESPONSE=false
7990
```
8091
The most recent Elasticsearch 7.x versions should also work. See the [opensearch-py docs](https://github.com/opensearch-project/opensearch-py/blob/main/COMPATIBILITY.md) for compatibility information.
8192

@@ -100,8 +111,9 @@ You can customize additional settings in your `.env` file:
100111
| `RELOAD` | Enable auto-reload for development. | `true` | Optional |
101112
| `STAC_FASTAPI_RATE_LIMIT` | API rate limit per client. | `200/minute` | Optional |
102113
| `BACKEND` | Tests-related variable | `elasticsearch` or `opensearch` based on the backend | Optional |
103-
| `ELASTICSEARCH_VERSION` | ElasticSearch version | `7.17.1` | Optional |
104-
| `OPENSEARCH_VERSION` | OpenSearch version | `2.11.0` | Optional |
114+
| `ELASTICSEARCH_VERSION` | Version of Elasticsearch to use. | `8.11.0` | Optional |
115+
| `ENABLE_DIRECT_RESPONSE` | Enable direct response for maximum performance (disables all FastAPI dependencies, including authentication, custom status codes, and validation) | `false` | Optional |
116+
| `OPENSEARCH_VERSION` | OpenSearch version | `2.11.1` | Optional |
105117

106118
> [!NOTE]
107119
> The variables `ES_HOST`, `ES_PORT`, `ES_USE_SSL`, and `ES_VERIFY_CERTS` apply to both Elasticsearch and OpenSearch backends, so there is no need to rename the key names to `OS_` even if you're using OpenSearch.

compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
environment:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
12-
- STAC_FASTAPI_VERSION=4.0.0a1
12+
- STAC_FASTAPI_VERSION=4.0.0a2
1313
- APP_HOST=0.0.0.0
1414
- APP_PORT=8080
1515
- RELOAD=true
@@ -41,7 +41,7 @@ services:
4141
environment:
4242
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4343
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
44-
- STAC_FASTAPI_VERSION=4.0.0a1
44+
- STAC_FASTAPI_VERSION=4.0.0a2
4545
- APP_HOST=0.0.0.0
4646
- APP_PORT=8082
4747
- RELOAD=true

examples/auth/compose.basic_auth.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
environment:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
12-
- STAC_FASTAPI_VERSION=4.0.0a1
12+
- STAC_FASTAPI_VERSION=4.0.0a2
1313
- APP_HOST=0.0.0.0
1414
- APP_PORT=8080
1515
- RELOAD=true
@@ -42,7 +42,7 @@ services:
4242
environment:
4343
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4444
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
45-
- STAC_FASTAPI_VERSION=4.0.0a1
45+
- STAC_FASTAPI_VERSION=4.0.0a2
4646
- APP_HOST=0.0.0.0
4747
- APP_PORT=8082
4848
- RELOAD=true

examples/auth/compose.oauth2.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
environment:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
12-
- STAC_FASTAPI_VERSION=4.0.0a1
12+
- STAC_FASTAPI_VERSION=4.0.0a2
1313
- APP_HOST=0.0.0.0
1414
- APP_PORT=8080
1515
- RELOAD=true
@@ -43,7 +43,7 @@ services:
4343
environment:
4444
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4545
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
46-
- STAC_FASTAPI_VERSION=4.0.0a1
46+
- STAC_FASTAPI_VERSION=4.0.0a2
4747
- APP_HOST=0.0.0.0
4848
- APP_PORT=8082
4949
- RELOAD=true

examples/auth/compose.route_dependencies.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
environment:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
12-
- STAC_FASTAPI_VERSION=4.0.0a1
12+
- STAC_FASTAPI_VERSION=4.0.0a2
1313
- APP_HOST=0.0.0.0
1414
- APP_PORT=8080
1515
- RELOAD=true
@@ -42,7 +42,7 @@ services:
4242
environment:
4343
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4444
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
45-
- STAC_FASTAPI_VERSION=4.0.0a1
45+
- STAC_FASTAPI_VERSION=4.0.0a2
4646
- APP_HOST=0.0.0.0
4747
- APP_PORT=8082
4848
- RELOAD=true

examples/rate_limit/compose.rate_limit.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
environment:
1010
- STAC_FASTAPI_TITLE=stac-fastapi-elasticsearch
1111
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Elasticsearch backend
12-
- STAC_FASTAPI_VERSION=4.0.0a1
12+
- STAC_FASTAPI_VERSION=4.0.0a2
1313
- APP_HOST=0.0.0.0
1414
- APP_PORT=8080
1515
- RELOAD=true
@@ -42,7 +42,7 @@ services:
4242
environment:
4343
- STAC_FASTAPI_TITLE=stac-fastapi-opensearch
4444
- STAC_FASTAPI_DESCRIPTION=A STAC FastAPI with an Opensearch backend
45-
- STAC_FASTAPI_VERSION=4.0.0a1
45+
- STAC_FASTAPI_VERSION=4.0.0a2
4646
- APP_HOST=0.0.0.0
4747
- APP_PORT=8082
4848
- RELOAD=true

stac_fastapi/core/setup.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
"attrs>=23.2.0",
1111
"pydantic>=2.4.1,<3.0.0",
1212
"stac_pydantic~=3.1.0",
13-
"stac-fastapi.api==5.1.1",
14-
"stac-fastapi.extensions==5.1.1",
15-
"stac-fastapi.types==5.1.1",
13+
"stac-fastapi.api==5.2.0",
14+
"stac-fastapi.extensions==5.2.0",
15+
"stac-fastapi.types==5.2.0",
1616
"orjson~=3.9.0",
1717
"overrides~=7.4.0",
1818
"geojson-pydantic~=1.0.0",

stac_fastapi/core/stac_fastapi/core/core.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ async def item_collection(
334334
search=search,
335335
limit=limit,
336336
sort=None,
337-
token=token, # type: ignore
337+
token=token,
338338
collection_ids=[collection_id],
339339
)
340340

@@ -633,7 +633,7 @@ async def post_search(
633633
items, maybe_count, next_token = await self.database.execute_search(
634634
search=search,
635635
limit=limit,
636-
token=search_request.token, # type: ignore
636+
token=search_request.token,
637637
sort=sort,
638638
collection_ids=search_request.collections,
639639
)
@@ -701,7 +701,10 @@ async def create_item(
701701
database=self.database, settings=self.settings
702702
)
703703
processed_items = [
704-
bulk_client.preprocess_item(item, base_url, BulkTransactionMethod.INSERT) for item in item["features"] # type: ignore
704+
bulk_client.preprocess_item(
705+
item, base_url, BulkTransactionMethod.INSERT
706+
)
707+
for item in item["features"]
705708
]
706709

707710
await self.database.bulk_async(

stac_fastapi/core/stac_fastapi/core/extensions/query.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from types import DynamicClassAttribute
1111
from typing import Any, Callable, Dict, Optional
1212

13-
from pydantic import BaseModel, root_validator
13+
from pydantic import BaseModel, model_validator
1414
from stac_pydantic.utils import AutoValueEnum
1515

1616
from stac_fastapi.extensions.core.query import QueryExtension as QueryExtensionBase
@@ -63,7 +63,7 @@ class QueryExtensionPostRequest(BaseModel):
6363

6464
query: Optional[Dict[str, Dict[Operator, Any]]] = None
6565

66-
@root_validator(pre=True)
66+
@model_validator(mode="before")
6767
def validate_query_fields(cls, values: Dict) -> Dict:
6868
"""Validate query fields."""
6969
...

stac_fastapi/core/stac_fastapi/core/utilities.py

+29
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,42 @@
33
This module contains functions for transforming geospatial coordinates,
44
such as converting bounding boxes to polygon representations.
55
"""
6+
import logging
7+
import os
68
from typing import Any, Dict, List, Optional, Set, Union
79

810
from stac_fastapi.types.stac import Item
911

1012
MAX_LIMIT = 10000
1113

1214

15+
def get_bool_env(name: str, default: bool = False) -> bool:
16+
"""
17+
Retrieve a boolean value from an environment variable.
18+
19+
Args:
20+
name (str): The name of the environment variable.
21+
default (bool, optional): The default value to use if the variable is not set or unrecognized. Defaults to False.
22+
23+
Returns:
24+
bool: The boolean value parsed from the environment variable.
25+
"""
26+
value = os.getenv(name, str(default).lower())
27+
true_values = ("true", "1", "yes", "y")
28+
false_values = ("false", "0", "no", "n")
29+
if value.lower() in true_values:
30+
return True
31+
elif value.lower() in false_values:
32+
return False
33+
else:
34+
logger = logging.getLogger(__name__)
35+
logger.warning(
36+
f"Environment variable '{name}' has unrecognized value '{value}'. "
37+
f"Expected one of {true_values + false_values}. Using default: {default}"
38+
)
39+
return default
40+
41+
1342
def bbox2polygon(b0: float, b1: float, b2: float, b3: float) -> List[List[List[float]]]:
1443
"""Transform a bounding box represented by its four coordinates `b0`, `b1`, `b2`, and `b3` into a polygon.
1544
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""library version."""
2-
__version__ = "4.0.0a1"
2+
__version__ = "4.0.0a2"

stac_fastapi/elasticsearch/setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
desc = f.read()
77

88
install_requires = [
9-
"stac-fastapi-core==4.0.0a1",
9+
"stac-fastapi-core==4.0.0a2",
1010
"elasticsearch[async]~=8.18.0",
1111
"uvicorn~=0.23.0",
1212
"starlette>=0.35.0,<0.36.0",

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/app.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
api = StacApi(
8888
title=os.getenv("STAC_FASTAPI_TITLE", "stac-fastapi-elasticsearch"),
8989
description=os.getenv("STAC_FASTAPI_DESCRIPTION", "stac-fastapi-elasticsearch"),
90-
api_version=os.getenv("STAC_FASTAPI_VERSION", "2.1"),
90+
api_version=os.getenv("STAC_FASTAPI_VERSION", "4.0.0a2"),
9191
settings=settings,
9292
extensions=extensions,
9393
client=CoreClient(

0 commit comments

Comments
 (0)