You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Blocking bulk_items endpoint when ENABLE_DATETIME_INDEX_FILTERING (stac-utils#438)
**Description:**
The `/collections/{collection_id}/bulk_items` endpoint does not work
when `ENABLE_DATETIME_INDEX_FILTERING` is set to true, as only the async
`/collections/{collection_id}/items` version was implemented while the
sync `/collections/{collection_id}/bulk_items` wasn't. This PR blocks
the /bulk_items endpoint when `ENABLE_DATETIME_INDEX_FILTERING` is set
to true.
**PR Checklist:**
- [x] Code is formatted and linted (run `pre-commit run --all-files`)
- [x] Tests pass (run `make test`)
- [ ] Documentation has been updated to reflect changes, if applicable
- [x] Changes are added to the changelog
---------
Co-authored-by: Jonathan Healy <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
16
16
### Changed
17
17
18
18
- Changed assets serialization to prevent mapping explosion while allowing asset inforamtion to be indexed. [#341](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/341)
19
+
- Blocked the /collections/{collection_id}/bulk_items endpoint when environmental variable ENABLE_DATETIME_INDEX_FILTERING is set to true. [#438](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/438)
Copy file name to clipboardExpand all lines: stac_fastapi/core/stac_fastapi/core/core.py
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -965,6 +965,13 @@ def bulk_item_insert(
965
965
A string indicating the number of items successfully added.
966
966
"""
967
967
request=kwargs.get("request")
968
+
969
+
ifos.getenv("ENABLE_DATETIME_INDEX_FILTERING"):
970
+
raiseHTTPException(
971
+
status_code=400,
972
+
detail="The /collections/{collection_id}/bulk_items endpoint is invalid when ENABLE_DATETIME_INDEX_FILTERING is set to true. Try using the /collections/{collection_id}/items endpoint.",
0 commit comments