From 65b014662736a88585c74b60808e6cd0975c6fbe Mon Sep 17 00:00:00 2001 From: luopengting Date: Wed, 22 Apr 2020 14:57:44 +0800 Subject: [PATCH] fix pylint, catch Exception for parsing summary --- mindinsight/lineagemgr/querier/querier.py | 2 +- mindinsight/lineagemgr/summary/lineage_summary_analyzer.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mindinsight/lineagemgr/querier/querier.py b/mindinsight/lineagemgr/querier/querier.py index 1ff6ef4..28d3b7f 100644 --- a/mindinsight/lineagemgr/querier/querier.py +++ b/mindinsight/lineagemgr/querier/querier.py @@ -318,7 +318,7 @@ class Querier: for offset_result in offset_results: for obj_name in ["metric", "user_defined"]: obj = getattr(offset_result, obj_name) - require = True if obj_name == "metric" else False + require = bool(obj_name == "metric") if obj and isinstance(obj, dict): for key, value in obj.items(): label = f'{obj_name}/{key}' diff --git a/mindinsight/lineagemgr/summary/lineage_summary_analyzer.py b/mindinsight/lineagemgr/summary/lineage_summary_analyzer.py index ff76b79..7d183b3 100644 --- a/mindinsight/lineagemgr/summary/lineage_summary_analyzer.py +++ b/mindinsight/lineagemgr/summary/lineage_summary_analyzer.py @@ -207,6 +207,10 @@ class LineageSummaryAnalyzer(SummaryAnalyzer): log.error("Failed to get lineage information.") log.exception(err) raise LineageSummaryAnalyzeException() + except Exception as err: + log.error("Failed to get lineage information.") + log.exception(err) + raise LineageSummaryAnalyzeException() return lineage_info -- GitLab