Skip to content

Commit 0f1ce5e

Browse files
committed
Fix import issue in series.pyi to resolve Ruff error
1 parent 926450b commit 0f1ce5e

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

pandas-stubs/core/series.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ from matplotlib.axes import (
3030
)
3131
import numpy as np
3232
from pandas import (
33+
Index,
3334
Period,
3435
PeriodDtype,
3536
Timedelta,
3637
Timestamp,
37-
Index,
3838
)
3939
from pandas.core.api import (
4040
Int8Dtype as Int8Dtype,
@@ -59,7 +59,6 @@ from pandas.core.indexes.accessors import (
5959
TimedeltaProperties,
6060
TimestampProperties,
6161
)
62-
from pandas.core.indexes.base import Index
6362
from pandas.core.indexes.category import CategoricalIndex
6463
from pandas.core.indexes.datetimes import DatetimeIndex
6564
from pandas.core.indexes.interval import IntervalIndex

test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
test
2+
ind abc

tests/test_series.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3541,6 +3541,12 @@ def test_series_dict() -> None:
35413541
)
35423542

35433543

3544+
def test_series_keys_type() -> None:
3545+
# GH 1101
3546+
s = pd.Series([1, 2, 3])
3547+
check(assert_type(s.keys(), pd.Index), pd.Index)
3548+
3549+
35443550
def test_series_int_float() -> None:
35453551
# pyright infers mixtures of int and float in a list as list[int | float]
35463552
check(assert_type(pd.Series([1, 2, 3]), "pd.Series[int]"), pd.Series, np.integer)

0 commit comments

Comments
 (0)