Skip to content

Commit 77e52e2

Browse files
committed
Fix q78 problematic value comparison
Signed-off-by: Yinqing Hao <[email protected]>
1 parent ce6a80e commit 77e52e2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

nds/nds_validate.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,12 @@ def rowEqual(row1, row2, epsilon, is_q78, q78_problematic_col):
179179
problematic_val_row2 = row2.pop(q78_problematic_col-1)
180180
problematic_val_eq = False
181181
# this value could be none in some rows
182-
if all([problematic_val_row1, problematic_val_row2]):
182+
if problematic_val_row1 is not None and problematic_val_row2 is not None:
183183
# this value is rounded to its pencentile: round(ss_qty/(coalesce(ws_qty,0)+coalesce(cs_qty,0)),2)
184184
# so we allow the diff <= 0.01 + default epsilon 0.00001
185185
problematic_val_eq = abs(problematic_val_row1 - problematic_val_row2) <= 0.01001
186-
elif problematic_val_row1 == None and problematic_val_row2 == None:
187-
problematic_val_eq = True
188186
else:
189-
problematic_val_eq = False
187+
problematic_val_eq = problematic_val_row1 is None and problematic_val_row2 is None
190188
return problematic_val_eq and all([compare(lhs, rhs, epsilon) for lhs, rhs in zip(row1, row2)])
191189
else:
192190
return all([compare(lhs, rhs, epsilon) for lhs, rhs in zip(row1, row2)])

0 commit comments

Comments
 (0)