Skip to content

Commit 36db306

Browse files
committed
floating
1 parent 6445809 commit 36db306

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
@@ -506,10 +506,7 @@ PyArrowTimestampDtypeArg: TypeAlias = Literal[
506506
"timestamp[ns][pyarrow]",
507507
]
508508
TimestampDtypeArg: TypeAlias = (
509-
PandasTimestampDtypeArg
510-
| PandasAstypeTimestampDtypeArg
511-
| NumpyTimestampDtypeArg
512-
| PyArrowTimestampDtypeArg
509+
PandasTimestampDtypeArg | NumpyTimestampDtypeArg | PyArrowTimestampDtypeArg
513510
)
514511
# Builtin str type and its string alias
515512
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
@@ -6,6 +6,7 @@
66

77
from tests import (
88
check,
9+
exception_on_platform,
910
get_dtype,
1011
)
1112
from tests._typing import (
@@ -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)