diff --git a/setup.py b/setup.py index 9a85b2f..04772d0 100644 --- a/setup.py +++ b/setup.py @@ -6,7 +6,7 @@ setup( name="tc-analyzer-lib", - version="1.4.8", + version="1.4.9", author="Mohammad Amin Dadgar, TogetherCrew", maintainer="Mohammad Amin Dadgar", maintainer_email="dadgaramin96@gmail.com", diff --git a/tc_analyzer_lib/tc_analyzer.py b/tc_analyzer_lib/tc_analyzer.py index 2a11beb..cb24734 100644 --- a/tc_analyzer_lib/tc_analyzer.py +++ b/tc_analyzer_lib/tc_analyzer.py @@ -232,9 +232,15 @@ def check_platform(self): f"Platform with platform_id: {self.platform_id} doesn't exist!" ) - def get_latest_networkx_graph(self, member_acitivities_networkx_data: dict): + def get_latest_networkx_graph( + self, member_acitivities_networkx_data: dict + ) -> dict | None: """ just getting the latest networkx object (latest graph) """ - latest_date = max(member_acitivities_networkx_data.keys()) - return {latest_date: member_acitivities_networkx_data[latest_date]} + # if there was any data availabe + if member_acitivities_networkx_data.keys(): + latest_date = max(member_acitivities_networkx_data.keys()) + return {latest_date: member_acitivities_networkx_data[latest_date]} + else: + return None