Skip to content

Commit

Permalink
Minor fix to structured_data to accumulate unique resolved_refs acros…
Browse files Browse the repository at this point in the history
…s schemas.
  • Loading branch information
dmichaels-harvard committed Dec 12, 2023
1 parent 2c15cec commit a447f3f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Change Log
8.6.0
=====
* Minor fix to misc_utils.to_integer to handle float strings.
* Minor fix to structured_data to accumulate unique resolved_refs across schemas.


8.5.0
Expand Down
6 changes: 3 additions & 3 deletions dcicutils/structured_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, file: Optional[str] = None, portal: Optional[Union[VirtualApp
self._prune = prune
self._warnings = {}
self._errors = {}
self._resolved_refs = []
self._resolved_refs = set()
self._validated = False
self._load_file(file) if file else None

Expand Down Expand Up @@ -96,7 +96,7 @@ def validation_errors(self) -> List[dict]:

@property
def resolved_refs(self) -> List[str]:
return self._resolved_refs
return list(self._resolved_refs)

@property
def upload_files(self) -> List[str]:
Expand Down Expand Up @@ -167,7 +167,7 @@ def _load_reader(self, reader: RowReader, type_name: str) -> None:
self._note_warning(reader.warnings, "reader")
if schema:
self._note_error(schema._unresolved_refs, "ref")
self._resolved_refs = schema._resolved_refs
self._resolved_refs.update(schema._resolved_refs)

def _add(self, type_name: str, data: Union[dict, List[dict]]) -> None:
if self._prune:
Expand Down

0 comments on commit a447f3f

Please sign in to comment.