Skip to content

Commit

Permalink
add testcase similar to test_all_any_params related to issue pandas-d…
Browse files Browse the repository at this point in the history
  • Loading branch information
linxiaow committed Apr 7, 2020
1 parent d441a2a commit 0b93cd4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pandas/tests/reductions/test_reductions.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,20 @@ def test_all_any_params(self):
with pytest.raises(NotImplementedError):
s.all(bool_only=True)

def test_all_any_boolean(self):
# Check skipna, with boolean type
s1 = Series([pd.NA, True], dtype="boolean")
s2 = Series([pd.NA, False], dtype="boolean")
assert pd.isna(s1.all(skipna=False)) # NA && True => NA
assert s1.all(skipna=True)
assert pd.isna(s2.any(skipna=False)) # NA || False => NA
assert not s2.any(skipna=True)
# GH-33253: all True / all False values buggy with skipna=False
s3 = Series([True, True], dtype="boolean")
s4 = Series([False, False], dtype="boolean")
assert s3.all(skipna=False)
assert not s4.any(skipna=False)

def test_timedelta64_analytics(self):

# index min/max
Expand Down

0 comments on commit 0b93cd4

Please sign in to comment.