Skip to content

Commit 9eb2ed8

Browse files
committed
fix: comments
1 parent 8ab6edd commit 9eb2ed8

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

pandas-stubs/core/indexes/accessors.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ from datetime import (
55
tzinfo as _tzinfo,
66
)
77
from typing import (
8+
Any,
89
Generic,
910
Literal,
1011
TypeVar,
@@ -444,8 +445,9 @@ class TimedeltaIndexProperties(
444445

445446
@type_check_only
446447
class DtDescriptor:
448+
# microsoft/pyright#10924
447449
@overload
448-
def __get__(self, instance: Series[Never], owner: type[Series]) -> Never: ...
450+
def __get__(self, instance: Series[Never], owner: type[Series]) -> Any: ...
449451
@overload
450452
def __get__(
451453
self, instance: Series[Timestamp], owner: type[Series]

pandas-stubs/core/series.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4624,11 +4624,11 @@ class Series(IndexOpsMixin[S1], NDFrame):
46244624
@overload
46254625
def to_numpy(
46264626
self: Series[Interval],
4627-
dtype: np.dtype[GenericT] | SupportsDType[GenericT] | type[GenericT],
4627+
dtype: np.dtype[np.bytes_],
46284628
copy: bool = False,
46294629
na_value: Scalar = ...,
46304630
**kwargs,
4631-
) -> np_1darray[GenericT]: ...
4631+
) -> np_1darray[np.bytes_]: ...
46324632
@overload
46334633
def to_numpy( # pyright: ignore[reportIncompatibleMethodOverride]
46344634
self,
@@ -4725,7 +4725,7 @@ class _SeriesSubclassBase(Series[S1], Generic[S1, GenericT_co]):
47254725

47264726
class PeriodSeries(_SeriesSubclassBase[Period, np.object_]):
47274727
@property
4728-
def dt(self) -> PeriodProperties: ... # type: ignore[override]
4728+
def dt(self) -> PeriodProperties: ...
47294729
def __sub__(self, other: PeriodSeries) -> OffsetSeries: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
47304730
def diff(self, periods: int = ...) -> OffsetSeries: ... # type: ignore[override] # pyright: ignore[reportIncompatibleMethodOverride]
47314731

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ scipy = { version = ">=1.9.1", python = "<3.14" }
6565
scipy-stubs = ">=1.15.3.0"
6666
SQLAlchemy = ">=2.0.39"
6767
types-python-dateutil = ">=2.8.19"
68-
beautifulsoup4 = ">=4.12.2"
68+
beautifulsoup4 = ">=4.12.2,!=4.14.0" # pandas-dev/pandas#62492
6969
html5lib = ">=1.1"
7070
python-calamine = ">=0.2.0"
7171

tests/series/test_properties.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
from typing import TYPE_CHECKING
1+
from typing import (
2+
TYPE_CHECKING,
3+
Any,
4+
)
25

36
import numpy as np
47
import pandas as pd
@@ -33,9 +36,8 @@ def test_dt_property() -> None:
3336
)
3437

3538
if TYPE_CHECKING_INVALID_USAGE:
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]
39+
assert_type(pd.DataFrame({"a": [1]})["a"].dt, Any)
40+
_1 = pd.Series([1]).dt # type: ignore[arg-type] # pyright: ignore[reportAttributeAccessIssue]
3941

4042

4143
def test_array_property() -> None:

0 commit comments

Comments
 (0)