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
When attempting to define a stac-fastapi-core-based application with the Query Extension disabled, I found that stac-fastapi-core would emit an attribute error and crashfail.
Specifically, the logic for handling a POST Search request here:
I found that this also happens with the sortby and token pagination extensions. Removing these makes the application inoperable.
To Reproduce
Create a new application, e.g., based off of the mongodb example
Remove the QueryExtension from the application's extensions
Start the app (it will start)
Send any valid POST Search
💥
Expected behavior
With Query disabled, searches should function.
The same holds for Sort and Token Pagination, but the case is clearest with Query (which is deprecated).
Additional context
I'm experimenting with building an application for my team, so I don't have a lot of knowledge around STAC. We're still learning the spec(s) and trying things out.
For now, we're trying to get a very early stage prototype up and running, so I've implemented this very clumsy hack:
I have been working on an adjacent issue and have added a condition for when an extension is enabled/disabled here #267. Maybe it is useful. Let me know if you have any suggestions for this approach.
**Related Issue(s):**
- #373
- #263
**Description:**
- Added the `ENABLE_TRANSACTIONS_EXTENSIONS` environment variable to
enable or disable the Transactions and Bulk Transactions API extensions.
When set to `false`, endpoints provided by `TransactionsClient` and
`BulkTransactionsClient` are not available. This allows for flexible
deployment scenarios and improved API control.
**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
Describe the bug
When attempting to define a
stac-fastapi-core
-based application with the Query Extension disabled, I found that stac-fastapi-core would emit an attribute error and crashfail.Specifically, the logic for handling a POST Search request here:
stac-fastapi-elasticsearch-opensearch/stac_fastapi/core/stac_fastapi/core/core.py
Line 566 in 49fecf9
I found that this also happens with the sortby and token pagination extensions. Removing these makes the application inoperable.
To Reproduce
Expected behavior
With Query disabled, searches should function.
The same holds for Sort and Token Pagination, but the case is clearest with Query (which is deprecated).
Additional context
I'm experimenting with building an application for my team, so I don't have a lot of knowledge around STAC. We're still learning the spec(s) and trying things out.
For now, we're trying to get a very early stage prototype up and running, so I've implemented this very clumsy hack:
I think the best pattern for the stac-fastapi-core code would be to check with
hasattr(...)
or three-argumentgetattr(..., ..., None)
.I'm happy to contribute a PR with this sort of fix if it would be welcome.
The text was updated successfully, but these errors were encountered: