-
-
Notifications
You must be signed in to change notification settings - Fork 154
pd.RangeIndex should accept range as the first argument #686
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
Conversation
Dr-Irv
left a comment
There was a problem hiding this 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?
let me push the code with the required test. |
|
@kshitiz305 checking on status of this PR |
|
@Dr-Irv Kindly have a look test for the range have been pushed |
|
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 |
|
Once #709 is merged, you will need to merge that in and revert changes to the 2 files I indicated. |
|
@kshitiz305 #709 has been merged, so can you merge with |
pyproject.toml
Outdated
| [tool.poetry] | ||
| name = "pandas-stubs" | ||
| version = "2.0.1.230501" | ||
| version = "2.0.1.230507" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert this change.
There was a problem hiding this comment.
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.
Dr-Irv
left a comment
There was a problem hiding this 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.
| def __init__( | ||
| self, | ||
| start: int | RangeIndex = ..., | ||
| cls, |
There was a problem hiding this comment.
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.
|
@kshitiz305 can you merge with main and get this finished up? |
pd.RangeIndexshould acceptrangeas the first argument #677 (Replace xxxx with the Github issue number)assert_type()to assert the type of any return value