Skip to content

Commit c245d55

Browse files
committed
Adding missing await.
1 parent 58d1061 commit c245d55

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

stac_fastapi/core/stac_fastapi/core/core.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,11 @@ async def patch_item(
820820
if item:
821821
return ItemSerializer.db_to_stac(item, base_url=base_url)
822822

823-
raise NotImplementedError("Content-Type and body combination not implemented")
823+
raise NotImplementedError(
824+
"Content-Type: %s and body: %s combination not implemented",
825+
content_type,
826+
patch,
827+
)
824828

825829
@overrides
826830
async def delete_item(self, item_id: str, collection_id: str, **kwargs) -> None:
@@ -903,7 +907,8 @@ async def update_collection(
903907
extensions=[type(ext).__name__ for ext in self.database.extensions],
904908
)
905909

906-
def patch_collection(
910+
@overrides
911+
async def patch_collection(
907912
self,
908913
collection_id: str,
909914
patch: Union[stac_types.PartialCollection, List[stac_types.PatchOperation]],
@@ -925,7 +930,7 @@ def patch_collection(
925930

926931
collection = None
927932
if isinstance(patch, list) and content_type == "application/json-patch+json":
928-
collection = self.database.json_patch_collection(
933+
collection = await self.database.json_patch_collection(
929934
collection_id=collection_id,
930935
operations=patch,
931936
base_url=base_url,
@@ -936,7 +941,7 @@ def patch_collection(
936941
"application/json",
937942
]:
938943
patch = partialCollectionValidator.validate_python(patch)
939-
collection = self.database.merge_patch_collection(
944+
collection = await self.database.merge_patch_collection(
940945
collection_id=collection_id,
941946
collection=patch,
942947
base_url=base_url,
@@ -949,7 +954,11 @@ def patch_collection(
949954
extensions=[type(ext).__name__ for ext in self.database.extensions],
950955
)
951956

952-
raise NotImplementedError("Content-Type and body combination not implemented")
957+
raise NotImplementedError(
958+
"Content-Type: %s and body: %s combination not implemented",
959+
content_type,
960+
patch,
961+
)
953962

954963
@overrides
955964
async def delete_collection(self, collection_id: str, **kwargs) -> None:

stac_fastapi/tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def __init__(
8080
url: str = "XXXX",
8181
app: Optional[Any] = None,
8282
query_params: Dict[str, Any] = {"limit": "10"},
83-
headers: Dict[str, Any] = {"Content-type": "application/json"},
83+
headers: Dict[str, Any] = {"content-type": "application/json"},
8484
):
8585
self.method = method
8686
self.url = url

0 commit comments

Comments
 (0)