Skip to content

Commit

Permalink
minor structured_data fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dmichaels-harvard committed Mar 14, 2024
1 parent 1dd7af7 commit f6d92e3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dcicutils/structured_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def _load_reader(self, reader: RowReader, type_name: str) -> None:
"refs_found": self.ref_total_found_count,
"refs_not_found": self.ref_total_notfound_count,
"refs_lookup": self.ref_lookup_count,
"refs_cache_hit": self.ref_lookup_cache_hit_count,
"refs_cache_hit": self.ref_exists_cache_hit_count,
"refs_invalid": self.ref_invalid_identifying_property_count
})
self._note_warning(reader.warnings, "reader")
Expand Down Expand Up @@ -1027,8 +1027,9 @@ def _get_type_name_and_value_from_path(path: str) -> Tuple[Optional[str], Option

def _ref_exists_from_cache(self, type_name: str, value: str) -> Optional[List[dict]]:
if self._ref_cache is not None:
self._ref_exists_cache_hit_count += 1
return self._ref_cache.get(f"/{type_name}/{value}", None)
if ref := self._ref_cache.get(f"/{type_name}/{value}", None):
self._ref_exists_cache_hit_count += 1
return ref
self._ref_exists_cache_miss_count += 1
return None

Expand Down

0 comments on commit f6d92e3

Please sign in to comment.