Skip to content

Commit 36b171b

Browse files
committed
added tests for empty
1 parent 7f78a64 commit 36b171b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pandas/tests/arrays/test_boolean.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,19 @@ def get_op_from_name(self, op_name):
360360

361361
return op
362362

363+
def test_empty_ok(self, all_logical_operators):
364+
a = pd.array([], dtype="boolean")
365+
op_name = all_logical_operators
366+
result = getattr(a, op_name)(True)
367+
tm.assert_extension_array_equal(a, result)
368+
369+
result = getattr(a, op_name)(False)
370+
tm.assert_extension_array_equal(a, result)
371+
372+
# TODO: pd.NA
373+
# result = getattr(a, op_name)(pd.NA)
374+
# tm.assert_extension_array_equal(a, result)
375+
363376
def test_logical_length_mismatch_raises(self, all_logical_operators):
364377
op_name = all_logical_operators
365378
a = pd.array([True, False, None], dtype="boolean")

0 commit comments

Comments
 (0)