Skip to content

Commit 7b2798d

Browse files
committed
linting fixes
1 parent 0821815 commit 7b2798d

File tree

6 files changed

+11
-9
lines changed

6 files changed

+11
-9
lines changed

stac_fastapi/core/stac_fastapi/core/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -906,7 +906,7 @@ def bulk_item_insert(
906906
return f"Successfully added {len(processed_items)} Items."
907907

908908

909-
_DEFAULT_QUERYABLES = {
909+
_DEFAULT_QUERYABLES: Dict[str, Dict[str, Any]] = {
910910
"id": {
911911
"description": "ID",
912912
"$ref": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json#/definitions/core/allOf/2/properties/id",
@@ -1013,7 +1013,7 @@ async def get_queryables(
10131013
if not collection_id:
10141014
return queryables
10151015

1016-
properties = {}
1016+
properties: Dict[str, Any] = queryables["properties"]
10171017
queryables.update(
10181018
{
10191019
"properties": properties,

stac_fastapi/core/stac_fastapi/core/database_logic.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"""Database logic core."""
2+
13
import os
24
from functools import lru_cache
35
from typing import Any, Dict, List, Optional, Protocol

stac_fastapi/core/stac_fastapi/core/extensions/query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from dataclasses import dataclass
99
from enum import auto
1010
from types import DynamicClassAttribute
11-
from typing import Any, Callable, Dict, Optional, Union
11+
from typing import Any, Callable, Dict, Optional
1212

1313
from pydantic import BaseModel, root_validator
1414
from stac_pydantic.utils import AutoValueEnum

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/database_logic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ async def get_one_item(self, collection_id: str, item_id: str) -> Dict:
273273
)
274274
except exceptions.NotFoundError:
275275
raise NotFoundError(
276-
f"Item {item_id} does not exist in Collection {collection_id}"
276+
f"Item {item_id} does not exist inside Collection {collection_id}"
277277
)
278278
return item["_source"]
279279

@@ -826,7 +826,7 @@ async def update_collection(
826826
"source": {"index": f"{ITEMS_INDEX_PREFIX}{collection_id}"},
827827
"script": {
828828
"lang": "painless",
829-
"source": f"""ctx._id = ctx._id.replace('{collection_id}', '{collection["id"]}'); ctx._source.collection = '{collection["id"]}' ;""",
829+
"source": f"""ctx._id = ctx._id.replace('{collection_id}', '{collection["id"]}'); ctx._source.collection = '{collection["id"]}' ;""", # noqa: E702
830830
},
831831
},
832832
wait_for_completion=True,

stac_fastapi/opensearch/stac_fastapi/opensearch/database_logic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ async def get_one_item(self, collection_id: str, item_id: str) -> Dict:
302302
)
303303
except exceptions.NotFoundError:
304304
raise NotFoundError(
305-
f"Item {item_id} does not exist in Collection {collection_id}"
305+
f"Item {item_id} does not exist inside Collection {collection_id}"
306306
)
307307
return item["_source"]
308308

@@ -858,7 +858,7 @@ async def update_collection(
858858
"source": {"index": f"{ITEMS_INDEX_PREFIX}{collection_id}"},
859859
"script": {
860860
"lang": "painless",
861-
"source": f"""ctx._id = ctx._id.replace('{collection_id}', '{collection["id"]}'); ctx._source.collection = '{collection["id"]}' ;""",
861+
"source": f"""ctx._id = ctx._id.replace('{collection_id}', '{collection["id"]}'); ctx._source.collection = '{collection["id"]}' ;""", # noqa: E702
862862
},
863863
},
864864
wait_for_completion=True,

stac_fastapi/tests/rate_limit/test_rate_limit.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async def test_rate_limit(app_client_rate_limit: AsyncClient, ctx):
1818
except RateLimitExceeded:
1919
status_code = 429
2020

21-
logger.info(f"Request {i+1}: Status code {status_code}")
21+
logger.info(f"Request {i + 1}: Status code {status_code}")
2222
assert (
2323
status_code == expected_status_code
2424
), f"Expected status code {expected_status_code}, but got {status_code}"
@@ -32,7 +32,7 @@ async def test_rate_limit_no_limit(app_client: AsyncClient, ctx):
3232
response = await app_client.get("/collections")
3333
status_code = response.status_code
3434

35-
logger.info(f"Request {i+1}: Status code {status_code}")
35+
logger.info(f"Request {i + 1}: Status code {status_code}")
3636
assert (
3737
status_code == expected_status_code
3838
), f"Expected status code {expected_status_code}, but got {status_code}"

0 commit comments

Comments
 (0)