Skip to content

Commit 83694ed

Browse files
committed
floating
1 parent 153fce8 commit 83694ed

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

pandas-stubs/_typing.pyi

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -504,10 +504,7 @@ PyArrowTimestampDtypeArg: TypeAlias = Literal[
504504
"timestamp[ns][pyarrow]",
505505
]
506506
TimestampDtypeArg: TypeAlias = (
507-
PandasTimestampDtypeArg
508-
| PandasAstypeTimestampDtypeArg
509-
| NumpyTimestampDtypeArg
510-
| PyArrowTimestampDtypeArg
507+
PandasTimestampDtypeArg | NumpyTimestampDtypeArg | PyArrowTimestampDtypeArg
511508
)
512509
# Builtin str type and its string alias
513510
BuiltinStrDtypeArg: TypeAlias = type[str] | Literal["str"]

tests/arrays/test_boolean_array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ def test_constructor() -> None:
2525

2626

2727
@pytest.mark.parametrize("dtype", get_dtype(PandasBooleanDtypeArg))
28-
def test_constructors_dtype(dtype: PandasBooleanDtypeArg):
28+
def test_constructor_dtype(dtype: PandasBooleanDtypeArg):
2929
check(assert_type(pd.array([True], dtype=dtype), BooleanArray), BooleanArray)

tests/arrays/test_numpy_extension_array.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
BuiltinDtypeArg,
99
NumpyNotTimeDtypeArg,
1010
check,
11+
exception_on_platform,
1112
get_dtype,
1213
)
1314

@@ -40,14 +41,19 @@ def test_constructor() -> None:
4041

4142

4243
@pytest.mark.parametrize("dtype", get_dtype(BuiltinDtypeArg | NumpyNotTimeDtypeArg))
43-
def test_constructors_dtype(dtype: BuiltinDtypeArg | NumpyNotTimeDtypeArg):
44+
def test_constructor_dtype(dtype: BuiltinDtypeArg | NumpyNotTimeDtypeArg):
4445
if dtype == "V" or "void" in str(dtype):
4546
check(
4647
assert_type(pd.array([b"1"], dtype=dtype), NumpyExtensionArray),
4748
NumpyExtensionArray,
4849
)
4950
else:
50-
check(
51-
assert_type(pd.array([1], dtype=dtype), NumpyExtensionArray),
52-
NumpyExtensionArray,
53-
)
51+
exc = exception_on_platform(dtype)
52+
if exc:
53+
with pytest.raises(exc):
54+
pd.array([1], dtype=dtype)
55+
else:
56+
check(
57+
assert_type(pd.array([1], dtype=dtype), NumpyExtensionArray),
58+
NumpyExtensionArray,
59+
)

0 commit comments

Comments
 (0)