Skip to content

Commit 8be54d1

Browse files
committed
Update comparator.py
1 parent 1234ff2 commit 8be54d1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

codeflash/verification/comparator.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
HAS_SCIPY = False
3232

3333
try:
34-
import pandas
34+
import pandas # noqa: ICN001
3535

3636
HAS_PANDAS = True
3737
except ImportError:
@@ -100,7 +100,7 @@ def comparator(orig: Any, new: Any, superset_obj=False) -> bool:
100100
if HAS_SQLALCHEMY:
101101
try:
102102
insp = sqlalchemy.inspection.inspect(orig)
103-
insp = sqlalchemy.inspection.inspect(new)
103+
insp = sqlalchemy.inspection.inspect(new) # noqa: F841
104104
orig_keys = orig.__dict__
105105
new_keys = new.__dict__
106106
for key in list(orig_keys.keys()):
@@ -115,7 +115,7 @@ def comparator(orig: Any, new: Any, superset_obj=False) -> bool:
115115
# scipy condition because dok_matrix type is also a instance of dict, but dict comparison doesn't work for it
116116
if isinstance(orig, dict) and not (HAS_SCIPY and isinstance(orig, scipy.sparse.spmatrix)):
117117
if superset_obj:
118-
return all(k in new.keys() and comparator(v, new[k], superset_obj) for k, v in orig.items())
118+
return all(k in new and comparator(v, new[k], superset_obj) for k, v in orig.items())
119119
if len(orig) != len(new):
120120
return False
121121
for key in orig:

0 commit comments

Comments
 (0)