Skip to content

Commit f7e7d0d

Browse files
committed
Amend object type checking in _compare_series_like for handling missingness
1 parent 113defe commit f7e7d0d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

malariagen_data/util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,11 +1538,11 @@ def _compare_series_like(actual, expect):
15381538

15391539
# Handle object arrays, these don't get nans compared properly.
15401540
t = actual.dtype
1541-
if t is object: # Type comparisons should use is, is not or isinstance() (Pylint).
1541+
1542+
if t.kind == "O":
15421543
expect = expect.fillna("NA")
15431544
actual = actual.fillna("NA")
1544-
1545-
if t.kind == "f":
1545+
elif t.kind == "f":
15461546
assert_allclose(actual.values, expect.values)
15471547
else:
15481548
assert_array_equal(actual.values, expect.values)

0 commit comments

Comments
 (0)