Skip to content

Commit 552b483

Browse files
committed
Precommit.
1 parent 51a7a76 commit 552b483

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/database_logic.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
PartialItem,
2828
PatchOperation,
2929
)
30-
3130
from stac_fastapi.sfeos_helpers import filter
3231
from stac_fastapi.sfeos_helpers.database import (
3332
apply_free_text_filter_shared,
@@ -44,6 +43,10 @@
4443
return_date,
4544
validate_refresh,
4645
)
46+
from stac_fastapi.sfeos_helpers.database.query import (
47+
ES_MAX_URL_LENGTH,
48+
add_collections_to_body,
49+
)
4750
from stac_fastapi.sfeos_helpers.database.utils import (
4851
merge_to_operations,
4952
operations_to_script,
@@ -61,9 +64,6 @@
6164
from stac_fastapi.types.rfc3339 import DateTimeType
6265
from stac_fastapi.types.stac import Collection, Item
6366

64-
from stac_fastapi.sfeos_helpers.database.query import add_collections_to_body, \
65-
ES_MAX_URL_LENGTH
66-
6767
logger = logging.getLogger(__name__)
6868

6969

stac_fastapi/opensearch/stac_fastapi/opensearch/database_logic.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@
4242
return_date,
4343
validate_refresh,
4444
)
45+
from stac_fastapi.sfeos_helpers.database.query import (
46+
ES_MAX_URL_LENGTH,
47+
add_collections_to_body,
48+
)
4549
from stac_fastapi.sfeos_helpers.database.utils import (
4650
merge_to_operations,
4751
operations_to_script,
@@ -62,9 +66,6 @@
6266
from stac_fastapi.types.rfc3339 import DateTimeType
6367
from stac_fastapi.types.stac import Collection, Item
6468

65-
from stac_fastapi.sfeos_helpers.database.query import add_collections_to_body, \
66-
ES_MAX_URL_LENGTH
67-
6869
logger = logging.getLogger(__name__)
6970

7071

stac_fastapi/sfeos_helpers/stac_fastapi/sfeos_helpers/database/query.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
ES_MAX_URL_LENGTH = 4096
1111

12+
1213
def apply_free_text_filter_shared(
1314
search: Any, free_text_queries: Optional[List[str]]
1415
) -> Any:
@@ -86,8 +87,10 @@ def populate_sort_shared(sortby: List) -> Optional[Dict[str, Dict[str, str]]]:
8687
return None
8788

8889

89-
def add_collections_to_body(collection_ids: List[str], query: Optional[Dict[str, Any]]) -> Dict[str, Any]:
90-
"""Adds a list of collection ids to the body of a query.
90+
def add_collections_to_body(
91+
collection_ids: List[str], query: Optional[Dict[str, Any]]
92+
) -> Dict[str, Any]:
93+
"""Add a list of collection ids to the body of a query.
9194
9295
Args:
9396
collection_ids (List[str]): A list of collections ids.
@@ -111,4 +114,4 @@ def add_collections_to_body(collection_ids: List[str], query: Optional[Dict[str,
111114
filters = query["bool"]["filter"]
112115
if index_filter not in filters:
113116
filters.append(index_filter)
114-
return query
117+
return query

0 commit comments

Comments
 (0)