Skip to content

Commit

Permalink
removed delete/purge functions from portal_utils.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmichaels-harvard committed Jun 11, 2024
1 parent 51d2206 commit 9ec0259
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 17 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Change Log
* Added Question class to command_utils (factored out of smaht-submitr).
* Refactored out some identifying property related code from portal_object_utils to portal_utils.
* Internalized lookup_strategy related code to structured_data/portal_object_utils/portal_utils.
* Added delete/purge_metadata to portal_utils.Portal, for testing and completeness.


8.9.0
Expand Down
16 changes: 1 addition & 15 deletions dcicutils/portal_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from webtest.app import TestApp, TestResponse
from wsgiref.simple_server import make_server as wsgi_make_server
from dcicutils.common import APP_SMAHT, OrchestratedApp, ORCHESTRATED_APPS
from dcicutils.ff_utils import delete_metadata, get_metadata, get_schema, patch_metadata, post_metadata, purge_metadata
from dcicutils.ff_utils import get_metadata, get_schema, patch_metadata, post_metadata
from dcicutils.misc_utils import to_camel_case, VirtualApp
from dcicutils.schema_utils import get_identifying_properties
from dcicutils.tmpfile_utils import temporary_file
Expand Down Expand Up @@ -280,20 +280,6 @@ def post_metadata(self, object_type: str, data: dict, check_only: bool = False)
add_on="check_only=True" if check_only else "")
return self.post(f"/{object_type}{'?check_only=True' if check_only else ''}", data).json()

def delete_metadata(self, object_id: str) -> Optional[dict]:
if isinstance(object_id, str) and object_id:
if self.key:
return delete_metadata(obj_id=object_id, key=self.key)
else:
return self.patch_metadata(object_id, {"status": "deleted"})
return None

def purge_metadata(self, object_id: str) -> Optional[dict]:
if isinstance(object_id, str) and object_id:
if self.key:
return purge_metadata(obj_id=object_id, key=self.key)
return None

def get_health(self) -> OptionalResponse:
return self.get("/health")

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "dcicutils"
version = "8.9.0.1b7" # TODO: To become 8.10.0
version = "8.9.0.1b8" # TODO: To become 8.10.0
description = "Utility package for interacting with the 4DN Data Portal and other 4DN resources"
authors = ["4DN-DCIC Team <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 9ec0259

Please sign in to comment.