Skip to content

Commit

Permalink
fixing comment and improving missing value check
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanDietzMorris committed Dec 17, 2024
1 parent 55af98b commit 2fa5d8c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Common/kgxmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,11 @@ def __post_init__(self, source_version, get_source_version):
raise Exception(f'Invalid DataSource initialization - '
f'source_version or get_source_version must be provided.')

# when
# when the source_version attribute is accessed either return _source_version if it is set
# or call the function supplied to retrieve it
def __getattribute__(self, name):
if name == "source_version":
if not self._source_version:
if self._source_version is None:
self._source_version = self._get_source_version(self.id)
return self._source_version
else:
Expand Down

0 comments on commit 2fa5d8c

Please sign in to comment.