Skip to content

Commit 7adb42d

Browse files
Fix tests to properly exercise lack of 'pd.NA' support.
1 parent 3fe9674 commit 7adb42d

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/test_series.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3284,12 +3284,14 @@ def callable(x: int | NAType) -> str | NAType:
32843284
return x
32853285

32863286
def bad_callable(x: int) -> int:
3287-
return x + 1
3287+
return x << 1
32883288

3289-
s.map(
3290-
bad_callable, na_action=None # type: ignore[arg-type] # pyright: ignore[reportCallIssue, reportArgumentType]
3291-
)
3292-
s.map(bad_callable) # type: ignore[arg-type] # pyright: ignore[reportArgumentType]
3289+
with pytest.raises(TypeError):
3290+
s.map(
3291+
bad_callable, na_action=None # type: ignore[arg-type] # pyright: ignore[reportCallIssue, reportArgumentType]
3292+
)
3293+
with pytest.raises(TypeError):
3294+
s.map(bad_callable) # type: ignore[arg-type] # pyright: ignore[reportArgumentType]
32933295
check(
32943296
assert_type(s.map(bad_callable, na_action="ignore"), "pd.Series[int]"),
32953297
pd.Series,

0 commit comments

Comments
 (0)