[go: up one dir, main page]

Skip to content
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

pd.RangeIndex should accept range as the first argument #686

Closed
wants to merge 0 commits into from

Conversation

kshitiz305
Copy link
Contributor

Copy link
Collaborator
@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test to tests/test_indexes.py that instantiates a RangeIndex with a range argument, using check and assert_type as in other tests?

pandas-stubs/_version.pyi Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
@kshitiz305
Copy link
Contributor Author

Can you add a test to tests/test_indexes.py that instantiates a RangeIndex with a range argument, using check and assert_type as in other tests?

let me push the code with the required test.

@Dr-Irv
Copy link
Collaborator
Dr-Irv commented May 21, 2023

@kshitiz305 checking on status of this PR

@kshitiz305
Copy link
Contributor Author

@Dr-Irv Kindly have a look test for the range have been pushed

@Dr-Irv
Copy link
Collaborator
Dr-Irv commented May 24, 2023

So there is a failure because pyright 1.1.309 started finding a whole bunch of issues. Trying to figure out what version to pin pyright to so things will work

@Dr-Irv Dr-Irv mentioned this pull request May 24, 2023
@Dr-Irv
Copy link
Collaborator
Dr-Irv commented May 24, 2023

Once #709 is merged, you will need to merge that in and revert changes to the 2 files I indicated.

@Dr-Irv
Copy link
Collaborator
Dr-Irv commented May 24, 2023

@kshitiz305 #709 has been merged, so can you merge with main, fix the reported issues, and push, then we can run the tests to see if everything works

pandas-stubs/_version.pyi Outdated Show resolved Hide resolved
pyproject.toml Outdated
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pandas-stubs"
version = "2.0.1.230501"
version = "2.0.1.230507"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can simply run git checkout <commit hash from before you made any changes> pandas-stubs/_version.pyi pyproject.toml to revert these two files to what they were before.

pandas-stubs/core/indexes/range.pyi Outdated Show resolved Hide resolved
Copy link
Collaborator
@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also should do poetry run poe style before the next push, as the CI is failing because of that.

pandas-stubs/core/indexes/range.pyi Outdated Show resolved Hide resolved
tests/test_indexes.py Outdated Show resolved Hide resolved
@kshitiz305
Copy link
Contributor Author

@Dr-Irv commit 6d89c40

Could you help me with this if this shall include the new or __ init__ as this is leading a confusion and also failing pyright

def __init__(
self,
start: int | RangeIndex = ...,
cls,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be self, because it is in __init__()

I think this is the cause of the pyright error you are getting.

@Dr-Irv
Copy link
Collaborator
Dr-Irv commented Aug 13, 2023

@kshitiz305 can you merge with main and get this finished up?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pd.RangeIndex should accept range as the first argument
3 participants