From cd2e9f620edf83749269abafc82a424996b471d4 Mon Sep 17 00:00:00 2001 From: fanglanyue Date: Mon, 14 Jul 2025 11:16:44 +0800 Subject: [PATCH] bugfix compare warning decimal convert --- .../compare_bean/origin_data_bean/operator_memory_bean.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/profiler/msprof_analyze/compare_tools/compare_backend/compare_bean/origin_data_bean/operator_memory_bean.py b/profiler/msprof_analyze/compare_tools/compare_backend/compare_bean/origin_data_bean/operator_memory_bean.py index 71e5548fe..9678b91ab 100644 --- a/profiler/msprof_analyze/compare_tools/compare_backend/compare_bean/origin_data_bean/operator_memory_bean.py +++ b/profiler/msprof_analyze/compare_tools/compare_backend/compare_bean/origin_data_bean/operator_memory_bean.py @@ -19,6 +19,7 @@ from msprof_analyze.compare_tools.compare_backend.utils.common_func import conve class OperatorMemoryBean: __slots__ = ['_data', '_name', '_size', '_allocation_time', '_release_time'] + NA = "N/A" def __init__(self, data: dict): self._data = data @@ -38,13 +39,13 @@ class OperatorMemoryBean: @property def allocation_time(self) -> Decimal: - if not self._allocation_time: + if not self._allocation_time or self._allocation_time == self.NA: return Decimal(0) return convert_to_decimal(self._allocation_time) @property def release_time(self) -> Decimal: - if not self._release_time: + if not self._release_time or self._release_time == self.NA: return Decimal(0) return convert_to_decimal(self._release_time) -- Gitee