Skip to content

Commit 310a25d

Browse files
author
thomas loubrieu
committed
update CHANGELOG, lint fix
1 parent 7696e58 commit 310a25d

File tree

2 files changed

+42
-11
lines changed

2 files changed

+42
-11
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1111

1212
- Added catalogs route support to enable federated hierarchical catalog browsing and navigation in the STAC API. [#547](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/547)
1313

14+
1415
### Changed
1516

17+
- Have opensearch datetime, geometry and collections fields defined as constant strings [#553](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/553)
18+
1619
### Fixed
1720

1821
- Fix unawaited coroutine in `stac_fastapi.core.core`. [#551](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/551)

stac_fastapi/opensearch/stac_fastapi/opensearch/database_logic.py

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,9 @@ def apply_ids_filter(search: Search, item_ids: List[str]):
445445
@staticmethod
446446
def apply_collections_filter(search: Search, collection_ids: List[str]):
447447
"""Database logic to search a list of STAC collection ids."""
448-
return search.filter("terms", **{DatabaseLogic.COLLECTION_FIELD:collection_ids})
448+
return search.filter(
449+
"terms", **{DatabaseLogic.COLLECTION_FIELD: collection_ids}
450+
)
449451

450452
@staticmethod
451453
def apply_free_text_filter(search: Search, free_text_queries: Optional[List[str]]):
@@ -506,10 +508,18 @@ def apply_datetime_filter(
506508
),
507509
Q(
508510
"bool",
509-
must_not=[Q("exists", field=DatabaseLogic.PROPERTIES_DATETIME_FIELD)],
511+
must_not=[
512+
Q("exists", field=DatabaseLogic.PROPERTIES_DATETIME_FIELD)
513+
],
510514
filter=[
511-
Q("exists", field=DatabaseLogic.PROPERTIES_START_DATETIME_FIELD),
512-
Q("exists", field=DatabaseLogic.PROPERTIES_END_DATETIME_FIELD),
515+
Q(
516+
"exists",
517+
field=DatabaseLogic.PROPERTIES_START_DATETIME_FIELD,
518+
),
519+
Q(
520+
"exists",
521+
field=DatabaseLogic.PROPERTIES_END_DATETIME_FIELD,
522+
),
513523
Q(
514524
"range",
515525
properties__start_datetime={
@@ -543,17 +553,29 @@ def apply_datetime_filter(
543553
),
544554
Q(
545555
"bool",
546-
must_not=[Q("exists", field=DatabaseLogic.PROPERTIES_DATETIME_FIELD)],
556+
must_not=[
557+
Q("exists", field=DatabaseLogic.PROPERTIES_DATETIME_FIELD)
558+
],
547559
filter=[
548-
Q("exists", field=DatabaseLogic.PROPERTIES_START_DATETIME_FIELD),
549-
Q("exists", field=DatabaseLogic.PROPERTIES_END_DATETIME_FIELD),
560+
Q(
561+
"exists",
562+
field=DatabaseLogic.PROPERTIES_START_DATETIME_FIELD,
563+
),
564+
Q(
565+
"exists",
566+
field=DatabaseLogic.PROPERTIES_END_DATETIME_FIELD,
567+
),
550568
Q(
551569
"range",
552-
properties__start_datetime={"lte": datetime_search["lte"]},
570+
properties__start_datetime={
571+
"lte": datetime_search["lte"]
572+
},
553573
),
554574
Q(
555575
"range",
556-
properties__end_datetime={"gte": datetime_search["gte"]},
576+
properties__end_datetime={
577+
"gte": datetime_search["gte"]
578+
},
557579
),
558580
],
559581
),
@@ -568,7 +590,10 @@ def apply_datetime_filter(
568590
filter_query = Q(
569591
"bool",
570592
filter=[
571-
Q("exists", field=DatabaseLogic.PROPERTIES_START_DATETIME_FIELD),
593+
Q(
594+
"exists",
595+
field=DatabaseLogic.PROPERTIES_START_DATETIME_FIELD,
596+
),
572597
Q("exists", field=DatabaseLogic.PROPERTIES_END_DATETIME_FIELD),
573598
Q(
574599
"range",
@@ -584,7 +609,10 @@ def apply_datetime_filter(
584609
filter_query = Q(
585610
"bool",
586611
filter=[
587-
Q("exists", field=DatabaseLogic.PROPERTIES_START_DATETIME_FIELD),
612+
Q(
613+
"exists",
614+
field=DatabaseLogic.PROPERTIES_START_DATETIME_FIELD,
615+
),
588616
Q("exists", field=DatabaseLogic.PROPERTIES_END_DATETIME_FIELD),
589617
Q(
590618
"range",

0 commit comments

Comments
 (0)