Skip to content

Commit

Permalink
Modified structured_data hook interface slightly to check for and cal…
Browse files Browse the repository at this point in the history
…l the "finish" attribute/callable hook.
  • Loading branch information
dmichaels-harvard committed Aug 22, 2024
1 parent 29256a2 commit 2b3eaa0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Change Log
======

* 2024-08-22 (dmichaels)
* Modified structured_data hook interface slightly to
check for and call the "finish" attribute/callable hook.
* Added portal_utils.Portal.head method.


Expand Down
4 changes: 4 additions & 0 deletions dcicutils/structured_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ def _load_normal_file(self, file: str) -> None:
self._load_json_file(file)
elif file.endswith(".tar") or file.endswith(".zip"):
self._load_packed_file(file)
if (self._validator_hook and
hasattr(self._validator_hook, "finish") and
callable(finish_validator_hook := getattr(self._validator_hook, "finish"))): # noqa
finish_validator_hook(self)

def _load_packed_file(self, file: str) -> None:
for file in unpack_files(file, suffixes=ACCEPTABLE_FILE_SUFFIXES):
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.14.2.1b2" # TODO: To become 8.14.3
version = "8.14.2.1b3" # TODO: To become 8.14.3
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 2b3eaa0

Please sign in to comment.