Skip to content

TYP: Fix return type of Series.keys() fro list to Index (#1101) #1106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pandas-stubs/core/series.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ from matplotlib.axes import (
)
import numpy as np
from pandas import (
Index,
Period,
PeriodDtype,
Timedelta,
Timestamp,
Index,
)
from pandas.core.api import (
Int8Dtype as Int8Dtype,
Expand All @@ -59,7 +59,6 @@ from pandas.core.indexes.accessors import (
TimedeltaProperties,
TimestampProperties,
)
from pandas.core.indexes.base import Index
from pandas.core.indexes.category import CategoricalIndex
from pandas.core.indexes.datetimes import DatetimeIndex
from pandas.core.indexes.interval import IntervalIndex
Expand Down
2 changes: 2 additions & 0 deletions test
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
test
ind abc
4 changes: 2 additions & 2 deletions tests/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -3543,8 +3543,8 @@ def test_series_dict() -> None:

def test_series_keys_type() -> None:
# GH 1101
s = pd.Series([1, 2, 3])
check(assert_type(s.keys(), pd.Index), pd.Index)
s = pd.Series([1, 2, 3])
check(assert_type(s.keys(), pd.Index), pd.Index)


def test_series_int_float() -> None:
Expand Down
Loading