pandas-dev / pandas-stubs

Public type stubs for pandas
BSD 3-Clause "New" or "Revised" License
229 stars 123 forks source link

Index.rename() should return Self #935

Open Dr-Irv opened 3 months ago

Dr-Irv commented 3 months ago

Describe the bug Index.rename() should return Self

To Reproduce

import pandas as pd

ind = pd.Index([1,2,3], name="foo")
ind2 = ind.rename("goo")
reveal_type(ind2)

shows that ind2 is unknown

Please complete the following information:

Dr-Irv commented 3 months ago

Need to fix rename() in core/indexes/base.pyi

devesh-2002 commented 3 months ago

May I take up this issue?

Dr-Irv commented 3 months ago

May I take up this issue?

Assigned to you. go ahead. Need a fix and a test.