Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch endpoints #744

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0cddff7
Adding patch endpoints.
rhysrevans3 Aug 20, 2024
14d18f9
Merge branch 'main' of github.com:stac-utils/stac-fastapi into patch_…
rhysrevans3 Aug 20, 2024
0c5de64
Adding annotated from main.
rhysrevans3 Aug 20, 2024
bf2ddbb
Fixing and adding tests.
rhysrevans3 Aug 21, 2024
632d5a5
Updating changelog.
rhysrevans3 Aug 21, 2024
5f2b4fa
Fixing ruff errors.
rhysrevans3 Aug 21, 2024
010e2cb
Ruff format.
rhysrevans3 Aug 21, 2024
0ccded0
Switching to List for python 3.8.
rhysrevans3 Aug 21, 2024
1b46754
Updating docs make file.
rhysrevans3 Aug 21, 2024
79c769c
Switching from Item/Collection to Dict to allow partial updates.
rhysrevans3 Aug 23, 2024
68a65a0
Ruff format fix.
rhysrevans3 Aug 23, 2024
88b40d4
Fixing broken tests.
rhysrevans3 Aug 23, 2024
b7bcbd5
Adding missing asyncs for patchs.
rhysrevans3 Aug 23, 2024
cfc31c6
Moving request to kwargs for patch item and collection.
rhysrevans3 Aug 23, 2024
81dbcad
Switching to TypedDict.
rhysrevans3 Aug 28, 2024
f053f07
Merge branch 'main' of github.com:stac-utils/stac-fastapi into patch_…
rhysrevans3 Aug 28, 2024
bce099c
Adding hearder parameter to the input models.
rhysrevans3 Aug 28, 2024
336df70
Removing print statement.
rhysrevans3 Aug 28, 2024
36b7167
Removing basemodel from patch types.
rhysrevans3 Aug 28, 2024
0ecf3e5
Fixing imports.
rhysrevans3 Aug 28, 2024
47a0b48
Moving models to correct locations.
rhysrevans3 Aug 28, 2024
13a2377
Switching from attrs to basemodel for patch operations.
rhysrevans3 Aug 28, 2024
7e59d13
Switching to stac.PartialItem etc.
rhysrevans3 Aug 28, 2024
9d011eb
Updating PatchMoveCopy model.
rhysrevans3 Sep 3, 2024
ae6bb94
Merge branch 'main' of github.com:stac-utils/stac-fastapi into patch_…
rhysrevans3 Sep 4, 2024
e325cb2
Updating type for 3.8.
rhysrevans3 Sep 4, 2024
fefd493
Switching to StacBaseModels for patch operations.
rhysrevans3 Sep 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Ruff format fix.
rhysrevans3 committed Aug 23, 2024
commit 68a65a083c669cec50593c2df18adf133f93fa3c
12 changes: 3 additions & 9 deletions stac_fastapi/extensions/tests/test_transaction.py
Original file line number Diff line number Diff line change
@@ -145,9 +145,7 @@ def test_merge_patch_item(client: TestClient, item: Item) -> None:


def test_json_patch_item(client: TestClient) -> None:
operations = [
{"op": "add", "path": "properties.new_prop", "value": "new_prop_value"}
]
operations = [{"op": "add", "path": "properties.new_prop", "value": "new_prop_value"}]
headers = {"Content-Type": "application/json-patch+json"}
response = client.patch(
"/collections/a-collection/items/an-item",
@@ -191,9 +189,7 @@ def test_merge_patch_collection(client: TestClient, collection: Collection) -> N


def test_json_patch_collection(client: TestClient) -> None:
operations = [
{"op": "add", "path": "summaries.new_prop", "value": "new_prop_value"}
]
operations = [{"op": "add", "path": "summaries.new_prop", "value": "new_prop_value"}]
headers = {"Content-Type": "application/json-patch+json"}
response = client.patch(
"/collections/a-collection/items/an-item",
@@ -273,9 +269,7 @@ def collection() -> Collection:
"description": "A test collection",
"extent": {
"spatial": {"bbox": [[-180, -90, 180, 90]]},
"temporal": {
"interval": [["2000-01-01T00:00:00Z", "2024-01-01T00:00:00Z"]]
},
"temporal": {"interval": [["2000-01-01T00:00:00Z", "2024-01-01T00:00:00Z"]]},
},
"links": [],
"assets": {},
16 changes: 4 additions & 12 deletions stac_fastapi/types/stac_fastapi/types/core.py
Original file line number Diff line number Diff line change
@@ -123,9 +123,7 @@ def patch_item(
)

else:
raise NotImplementedError(
"Content-Type and body combination not implemented"
)
raise NotImplementedError("Content-Type and body combination not implemented")

@abc.abstractmethod
def merge_patch_item(
@@ -253,9 +251,7 @@ def patch_collection(
return self.merge_patch_collection(collection_id, patch, **kwargs)

else:
raise NotImplementedError(
"Content-Type and body combination not implemented"
)
raise NotImplementedError("Content-Type and body combination not implemented")

@abc.abstractmethod
def merge_patch_collection(
@@ -398,9 +394,7 @@ def patch_item(
)

else:
raise NotImplementedError(
"Content-Type and body combination not implemented"
)
raise NotImplementedError("Content-Type and body combination not implemented")

@abc.abstractmethod
def merge_patch_item(
@@ -528,9 +522,7 @@ def patch_collection(
return self.merge_patch_collection(collection_id, patch, **kwargs)

else:
raise NotImplementedError(
"Content-Type and body combination not implemented"
)
raise NotImplementedError("Content-Type and body combination not implemented")

@abc.abstractmethod
def merge_patch_collection(