Skip to content

Commit c2f8366

Browse files
committed
fix filter lang errors?
1 parent 290952f commit c2f8366

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,10 @@ async def post_search(
313313

314314
if hasattr(search_request, "filter"):
315315
cql2_filter = getattr(search_request, "filter", None)
316-
if filter_lang in [None, FilterLang.cql2_json]:
316+
if filter_lang in [None, FilterLang.cql2_json, FilterLang.cql_json]:
317317
search = self.database.apply_cql2_filter(search, cql2_filter)
318-
# else:
319-
# raise Exception("CQL2-Text is not supported with POST")
318+
else:
319+
raise Exception("CQL2-Text is not supported with POST")
320320

321321
sort = None
322322
if search_request.sortby:

stac_fastapi/elasticsearch/tests/extensions/test_filter.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ async def test_search_filter_extension_eq(app_client, ctx):
2929
assert len(resp_json["features"]) == 1
3030

3131

32-
@pytest.mark.skip(reason="AssertionError: assert 1 == 0, second test fails")
3332
async def test_search_filter_extension_gte(app_client, ctx):
3433
# there's one item that can match, so one of these queries should match it and the other shouldn't
3534
params = {

0 commit comments

Comments
 (0)