Skip to content

Commit

Permalink
Added to_number function to misc_utils.
Browse files Browse the repository at this point in the history
  • Loading branch information
dmichaels-harvard committed Aug 6, 2024
1 parent a8d118d commit 893b333
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions dcicutils/structured_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,17 @@ def _note_issue(self, issues: dict, item: Optional[Union[dict, List[dict]]], gro
issues[group] = []
issues[group].extend(item)

def note_validation_error(self, validation_error: str, schema_name: Optional[str] = None, row_number: Optional[int] = None) -> None:
if isinstance(validation_error, str) and validation_error:
if isinstance(schema_name, str) and schema_name:
if isinstance(row_number, int):
src = create_dict(type=schema_name, row=row_number)
else:
src = create_dict(type=schema_name)
else:
src = None
self._note_error({"src": src, "error": validation_error}, "validation")


class _StructuredRowTemplate:

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.13.3.1b17" # TODO: To become 8.14.0
version = "8.13.3.1b18" # TODO: To become 8.14.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 893b333

Please sign in to comment.