Skip to content

Commit

Permalink
fixed vitaly comment
Browse files Browse the repository at this point in the history
Signed-off-by: Elad Gershon <egershon@nvidia.com>
  • Loading branch information
egershonNvidia committed Aug 14, 2024
1 parent 8ebc25d commit d5529c1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def get_counter(counter_name, row, default=0):
or its value is NaN.
"""
try:
val = row.get(counter_name) if (row.get(counter_name) is not None and not numpy.isnan(row.get(counter_name))) else default
val = row.get(counter_name) if (row.get(counter_name) is not None and not pd.isna(row.get(counter_name))) else default
except Exception as e:
return default
return val
Expand Down Expand Up @@ -439,8 +439,8 @@ def check_temp_issue(self, port_obj, row, timestamp):
if not self.temp_check:
return None
cable_temp = get_counter(Constants.TEMP_COUNTER, row, default=None)
if cable_temp is not None and not numpy.isnan(cable_temp):
if cable_temp in ["NA", "N/A", "", "0C"]:
if cable_temp is not None and not pd.isna(cable_temp):
if cable_temp in ["NA", "N/A", "", "0C", "0"]:
return None
cable_temp = int(cable_temp.split("C")[0]) if type(cable_temp) == str else cable_temp
old_cable_temp = port_obj.counters_values.get(Constants.TEMP_COUNTER, 0)
Expand Down

0 comments on commit d5529c1

Please sign in to comment.