提交 30e017e2 编写于 作者: K kouzhenzhong

lineagemgr: fix pylint warning

上级 15a7ad78
......@@ -226,7 +226,7 @@ class SearchModelConditionParameter(Schema):
if not isinstance(attr, str):
raise LineageParamValueError('The search attribute not supported.')
if attr not in FIELD_MAPPING and not attr.startswith(('metric/','user_defined/')):
if attr not in FIELD_MAPPING and not attr.startswith(('metric/', 'user_defined/')):
raise LineageParamValueError('The search attribute not supported.')
if not isinstance(condition, dict):
......
......@@ -355,8 +355,7 @@ def validate_condition(search_condition):
raise LineageParamValueError(err_msg)
if not (sorted_name in FIELD_MAPPING
or (sorted_name.startswith('metric/') and len(sorted_name) > 7)
or (sorted_name.startswith('user_defined/') and len(sorted_name) > 13)
):
or (sorted_name.startswith('user_defined/') and len(sorted_name) > 13)):
log.error(err_msg)
raise LineageParamValueError(err_msg)
......
......@@ -15,8 +15,8 @@
"""The converter between proto format event of lineage and dict."""
import time
from mindinsight.datavisual.proto_files.mindinsight_lineage_pb2 import LineageEvent, UserDefinedInfo
from mindinsight.lineagemgr.common.exceptions.exceptions import LineageParamTypeError,\
from mindinsight.datavisual.proto_files.mindinsight_lineage_pb2 import LineageEvent
from mindinsight.lineagemgr.common.exceptions.exceptions import LineageParamTypeError, \
LineageParamValueError
from mindinsight.lineagemgr.common.log import logger as log
......
......@@ -30,10 +30,9 @@ from mindinsight.lineagemgr import filter_summary_lineage, get_summary_lineage
from mindinsight.lineagemgr.common.exceptions.exceptions import (LineageFileNotFoundError, LineageParamSummaryPathError,
LineageParamTypeError, LineageParamValueError,
LineageSearchConditionParamError)
from ..conftest import BASE_SUMMARY_DIR, DATASET_GRAPH, SUMMARY_DIR, SUMMARY_DIR_2
from .....ut.lineagemgr.querier import event_data
from os import environ
LINEAGE_INFO_RUN1 = {
'summary_dir': os.path.join(BASE_SUMMARY_DIR, 'run1'),
'metric': {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册