File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed
Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff line change 88- disable transaction and bulk_transactions extensions by default ** breaking change**
99- update ` stac-fastapi-* ` version requirements to ` >=5.2,<6.0 `
1010- add pgstac health-check in ` /_mgmt/health `
11+ - switch from using pygeofilter to cql2
1112
1213## [ 5.0.2] - 2025-04-07
1314
Original file line number Diff line number Diff line change 1515 "asyncpg" ,
1616 "buildpg" ,
1717 "brotli_asgi" ,
18- "pygeofilter >=0.2 " ,
18+ "cql2 >=0.3.6 " ,
1919 "pypgstac>=0.8,<0.10" ,
2020]
2121
Original file line number Diff line number Diff line change 99import orjson
1010from asyncpg .exceptions import InvalidDatetimeFormatError
1111from buildpg import render
12+ from cql2 import Expr
1213from fastapi import HTTPException , Request
1314from pydantic import ValidationError
14- from pygeofilter .backends .cql2_json import to_cql2
15- from pygeofilter .parsers .cql2_text import parse as parse_cql2_text
1615from pypgstac .hydration import hydrate
1716from stac_fastapi .api .models import JSONResponse
1817from stac_fastapi .types .core import AsyncBaseCoreClient , Relations
@@ -556,11 +555,12 @@ def _clean_search_args( # noqa: C901
556555 """Clean up search arguments to match format expected by pgstac"""
557556 if filter_query :
558557 if filter_lang == "cql2-text" :
559- filter_query = to_cql2 (parse_cql2_text (filter_query ))
560- filter_lang = "cql2-json"
561-
562- base_args ["filter" ] = orjson .loads (filter_query )
563- base_args ["filter_lang" ] = filter_lang
558+ e = Expr (filter_query )
559+ base_args ["filter" ] = e .to_json ()
560+ base_args ["filter_lang" ] = "cql2-json"
561+ else :
562+ base_args ["filter" ] = orjson .loads (filter_query )
563+ base_args ["filter_lang" ] = filter_lang
564564
565565 if datetime :
566566 base_args ["datetime" ] = datetime
You can’t perform that action at this time.
0 commit comments