Skip to content

Commit 969c113

Browse files
committed
floating
1 parent e060436 commit 969c113

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