-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: add ignore index to DataFrame / Series.sample #38594
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
ENH: add ignore index to DataFrame / Series.sample #38594
Conversation
Hello @erfannariman! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2020-12-31 17:42:29 UTC |
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.
looks good small comment. pls merge master (and some checks are failing)
Apparently this error is raised because I define So this will be correct: RandomState = Union[int, ArrayLike, np.random.Generator, np.random.RandomState] While the following will raise the type annotation error. if np_version_under1p17:
RandomState = Union[int, ArrayLike, np.random.RandomState]
else:
RandomState = Union[int, ArrayLike, np.random.Generator, np.random.RandomState] |
@MarcoGorelli @arw2019 @jreback for now I removed defining the RandomState = Union[int, ArrayLike, np.random.Generator, np.random.RandomState] |
you can just define the type conditionally based on numpy version do not use Any (u can also remove the Any and open an issue) |
Can you check my comment above about:
You mean an issue that we still have to set typehint for |
a number of typing error: https://github.com/pandas-dev/pandas/pull/38594/checks?check_run_id=1631115163 |
Fixing the typing here isn't so easy - there's Line 5307 in a97d90a
which probably wants renaming, because on the right you have Then there's Line 5321 in a97d90a
, where the return type of |
Looks like the overload approach is taken in Lines 4841 to 4872 in 9159513
|
Thanks for having a in-depth look at this. This turned out to be way more complex and time consuming than I thought. Would it be an idea to open a new ticket for overload on |
Sounds reasonable to me. If this is ready apart from that, maybe it's OK to leave |
@erfannariman if you can merge master and see if can get to green (we can defer the typing on the random if that's causing an issue) |
Yes sure, will do this weekend, this one is basically ready to go except the typing complexity. |
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this. |
This is done now, if you merge upstream/master then the typing should be a lot simpler here |
@erfannariman can you merge master #38594 (comment) |
@erfannariman Thanks for the PR. closing as stale. ping if you want to continue. |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff