-
-
Notifications
You must be signed in to change notification settings - Fork 154
gh-624 : Added index parameter to to_dict and added axis argument to Series.add_suffix(), DataFrame.add_suffix(), Series.add_prefix() and DataFrame.add_prefix()
#638
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.
Fix as suggested, and investigate failures in mypy
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.
I think, but I'm not sure, that the changes I suggested will fix your problems. You have to really understand how typing works to debug what is going on. Make the changes incrementally, and test locally.
Yes now I'll try harder in the all upcoming issues |
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 also add a set of tests for this, i.e., test index=True and index=False with different values of orient . Test the index arguments of add_prefix() and add_suffix() as well.
When index=False is not allowed, then just do an assert_type() test, surrounded by if TYPE_CHECKING_INVALID_USAGE: with a correct # type: ignore[???] # pyright: ignore[reportGeneralTypeIssues] Idea here is to make sure that from a typing perspective, we have tested that we are rejecting False when it is not allowed.
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.
thanks @ramvikrams
Thanks sir |
assert_type()to assert the type of any return valueI added the parameters, but just a question do we have to add test in these compatibility changes also