From 2fa5d8cd47680a9ca6c87356b52d800c728e28b0 Mon Sep 17 00:00:00 2001 From: Evan Morris Date: Tue, 17 Dec 2024 11:28:10 -0500 Subject: [PATCH] fixing comment and improving missing value check --- Common/kgxmodel.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Common/kgxmodel.py b/Common/kgxmodel.py index 1813a5a7..1ce3b41a 100644 --- a/Common/kgxmodel.py +++ b/Common/kgxmodel.py @@ -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: