Skip to content

Commit 0b93cd4

Browse files
committed
add testcase similar to test_all_any_params related to issue pandas-dev#33253
1 parent d441a2a commit 0b93cd4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pandas/tests/reductions/test_reductions.py

+14
Original file line numberDiff line numberDiff line change
@@ -863,6 +863,20 @@ def test_all_any_params(self):
863863
with pytest.raises(NotImplementedError):
864864
s.all(bool_only=True)
865865

866+
def test_all_any_boolean(self):
867+
# Check skipna, with boolean type
868+
s1 = Series([pd.NA, True], dtype="boolean")
869+
s2 = Series([pd.NA, False], dtype="boolean")
870+
assert pd.isna(s1.all(skipna=False)) # NA && True => NA
871+
assert s1.all(skipna=True)
872+
assert pd.isna(s2.any(skipna=False)) # NA || False => NA
873+
assert not s2.any(skipna=True)
874+
# GH-33253: all True / all False values buggy with skipna=False
875+
s3 = Series([True, True], dtype="boolean")
876+
s4 = Series([False, False], dtype="boolean")
877+
assert s3.all(skipna=False)
878+
assert not s4.any(skipna=False)
879+
866880
def test_timedelta64_analytics(self):
867881

868882
# index min/max

0 commit comments

Comments
 (0)