Skip to content

Commit 7cd514e

Browse files
committed
fix: comments
1 parent 0ba9781 commit 7cd514e

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

pandas-stubs/core/indexes/accessors.pyi

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ from datetime import (
77
from typing import (
88
Generic,
99
Literal,
10+
Never,
1011
TypeVar,
1112
overload,
1213
type_check_only,
@@ -399,6 +400,8 @@ class CombinedDatetimelikeProperties(
399400
_TimedeltaPropertiesNoRounding[Series[int], Series[float]],
400401
_PeriodProperties,
401402
): ...
403+
404+
@type_check_only
402405
class TimestampProperties(
403406
DatetimeProperties[
404407
Series[int],
@@ -445,6 +448,8 @@ class TimedeltaIndexProperties(
445448

446449
@type_check_only
447450
class DtDescriptor:
451+
@overload
452+
def __get__(self, instance: Series[Never], owner: type[Series]) -> Never: ...
448453
@overload
449454
def __get__(
450455
self, instance: Series[Timestamp], owner: type[Series]
@@ -456,6 +461,10 @@ class DtDescriptor:
456461

457462
@type_check_only
458463
class ArrayDescriptor:
464+
@overload
465+
def __get__(
466+
self, instance: IndexOpsMixin[Never], owner: type[IndexOpsMixin]
467+
) -> ExtensionArray: ...
459468
@overload
460469
def __get__(
461470
self, instance: IndexOpsMixin[CategoricalDtype], owner: type[IndexOpsMixin]

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ numpy = ">= 1.23.5"
3939
mypy = "1.18.2"
4040
pandas = "2.3.2"
4141
pyarrow = ">=10.0.1"
42-
pytest = ">=7.1.2"
42+
pytest = ">=8.4.2"
4343
pyright = ">=1.1.405"
4444
ty = ">=0.0.1a21"
45-
pyrefly = ">=0.33.1"
45+
pyrefly = ">=0.34.0"
4646
poethepoet = ">=0.16.5"
4747
loguru = ">=0.6.0"
4848
typing-extensions = ">=4.4.0"
4949
matplotlib = ">=3.10.1"
5050
pre-commit = ">=2.19.0"
51-
black = ">=25.1.0"
51+
black = ">=25.9.0"
5252
isort = ">=6.0.1"
5353
openpyxl = ">=3.0.10"
5454
tables = { version = ">=3.10.1", python = "<4" }

tests/indexes/test_indexes.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,6 @@ def test_array_property() -> None:
15471547
TimedeltaArray,
15481548
pd.Timedelta,
15491549
)
1550-
# Should be NumpyExtensionArray
15511550
check(assert_type(Index([1]).array, ExtensionArray), ExtensionArray, np.integer)
15521551

15531552

tests/series/test_properties.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ def test_dt_property() -> None:
3333
)
3434

3535
if TYPE_CHECKING_INVALID_USAGE:
36-
_ = pd.Series([1]).dt # type: ignore[arg-type] # pyright: ignore[reportAttributeAccessIssue]
36+
# mypy gives Any
37+
_0 = pd.Series([1, "s"]).dt # pyright: ignore[reportAttributeAccessIssue]
38+
_1 = pd.Series([1]).dt # type: ignore[arg-type,var-annotated] # pyright: ignore[reportAttributeAccessIssue]
3739

3840

3941
def test_array_property() -> None:
@@ -55,5 +57,6 @@ def test_array_property() -> None:
5557
TimedeltaArray,
5658
pd.Timedelta,
5759
)
58-
# Should be NumpyExtensionArray
5960
check(assert_type(pd.Series([1]).array, ExtensionArray), ExtensionArray, np.integer)
61+
# mypy gives Any
62+
check(assert_type(pd.Series([1, "s"]).array, ExtensionArray), ExtensionArray) # type: ignore[assert-type]

0 commit comments

Comments
 (0)