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

added deprecate_nonkeyword_arguments to function where #41523

Merged
merged 26 commits into from May 26, 2021

Conversation

Jiezheng2018
Copy link
Contributor

@Jiezheng2018 Jiezheng2018 commented May 17, 2021

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Thanks @Jiezheng2018 , this is off to a good start - if you look at #41486 you'll see an example of how to add a whatsnew note and a test

pandas/core/generic.py Outdated Show resolved Hide resolved
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Getting there! 💪

pandas/tests/generic/test_generic.py Outdated Show resolved Hide resolved
Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Thanks @Jiezheng2018 for updating!

Just left a couple of comments - please have a look at #41510 for the most up-to-date example of how to do this, as that PR got merged

pandas/core/generic.py Outdated Show resolved Hide resolved
pandas/tests/generic/test_generic.py Outdated Show resolved Hide resolved
@Jiezheng2018
Copy link
Contributor Author

It has failed all Azure tests on py37_32bit. Not sure what I should do now?

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Thanks @Jiezheng2018, just a few more comments!

The test failure is caused by the stacklevel of another warning inside where not being set correctly - pretty sure it'll be enough to just increase the stacklevel to 3 in the lines

pandas/pandas/core/generic.py

Lines 9253 to 9258 in b3e3352

warnings.warn(
"try_cast keyword is deprecated and will be removed in a "
"future version",
FutureWarning,
stacklevel=2,
)

doc/source/whatsnew/v1.3.0.rst Outdated Show resolved Hide resolved
pandas/tests/frame/indexing/test_where.py Outdated Show resolved Hide resolved
pandas/tests/series/indexing/test_where.py Outdated Show resolved Hide resolved
pandas/core/generic.py Outdated Show resolved Hide resolved
@simonjayhawkins simonjayhawkins added the Deprecate Functionality to remove in pandas label May 21, 2021
@Jiezheng2018
Copy link
Contributor Author

Thanks a lot for the comments :) I will work on them over the weekend.

(P.S. I am really learning a lot by reading up your comments and documents and fixing error code. Really appreciated your patience with me. I might respond a bit slower in the coming week but be assured that I am commited to get this issue done :)

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Glad to hear you're learning a lot from this 😄

In a different PR (#41580 (comment)), Jeff has asked for other to be positional, so let's change this to be allowed_args=["self", "cond"] - sorry for having midled you!


EDIT: you'd already set it as positional, so my comment here was worse than useless 🤦 My bad for leaving a review when I hadn't slept that well...

@simonjayhawkins simonjayhawkins added this to the 1.3 milestone May 24, 2021
@Jiezheng2018
Copy link
Contributor Author

Jiezheng2018 commented May 24, 2021

Glad to hear you're learning a lot from this 😄

In a different PR (#41580 (comment)), Jeff has asked for other to be positional, so let's change this to be allowed_args=["self", "cond"] - sorry for having midled you!

No problem at all. I haven't made much progress because I kept running into problems each time I do a git fetch upstream and git merge upstream/master. (My understanding is that I should do this each time before I start working, right?)

I can't merge successfully because other people are also working on the same file (which is to be expected). However, what is really confusing for me is that the merge still fails sometimes, even after I removed all my changes. Error messages are to do with uncommitted changes. Trying git commit then I start failing on other pre-commit checks, either black, flake8 or absolufy-imports. Am I doing something stupid here?

I bypassed the above eventually by discarding all of my changes and aborted the merge and used git checkout --theirs .
Is this the correct way of doing it?

@Jiezheng2018
Copy link
Contributor Author

Hi,
I think I have managed to complete all of your requests now. Do you mind having another look? I might miss or revert some of my previous work because of my git merge issues.

@Jiezheng2018
Copy link
Contributor Author

Jiezheng2018 commented May 25, 2021

Morning, it seems like I failed a lot of tests again. I had to change the future warning 'stack level' back to 2, otherwise, I was failing all 'black' pre-commit tests with an error code of 123. I will do a bit more research and try to work on it later today or tomorrow.

@MarcoGorelli
Copy link
Member

Morning, it seems like I failed a lot of tests again. I had to change the future warning 'stack level' back to 2, otherwise, I was failing all 'black' pre-commit tests with an error code of 123. I will do a bit more research and try to work on it later today or tomorrow.

Hey @Jiezheng2018 - no worries, I've added a commit to fix some things up (partially to make sure this gets done in time, and partially because I'd misled you in some previous reviews 😳 ) - do you want to have a look at the recent changes?

I had to change the future warning 'stack level' back to 2, otherwise, I was failing all 'black' pre-commit tests with an error code of 123

I'm pretty sure that's not the kind of thing the black formatter would complain about - perhaps you also changed something else and caused a syntax error by accident?

@Jiezheng2018
Copy link
Contributor Author

Glad to hear you're learning a lot from this 😄

In a different PR (#41580 (comment)), Jeff has asked for other to be positional, so let's change this to be allowed_args=["self", "cond"] - sorry for having midled you!

EDIT: you'd already set it as positional, so my comment here was worse than useless 🤦 My bad for leaving a review when I hadn't slept that well...

No worries at all. :) Now I understand the positional keyword even better, was gonna read up on it more after work today. :) thanks a lot

@Jiezheng2018
Copy link
Contributor Author

Morning, it seems like I failed a lot of tests again. I had to change the future warning 'stack level' back to 2, otherwise, I was failing all 'black' pre-commit tests with an error code of 123. I will do a bit more research and try to work on it later today or tomorrow.

Hey @Jiezheng2018 - no worries, I've added a commit to fix some things up (partially to make sure this gets done in time, and partially because I'd misled you in some previous reviews 😳 ) - do you want to have a look at the recent changes?

I had to change the future warning 'stack level' back to 2, otherwise, I was failing all 'black' pre-commit tests with an error code of 123

I'm pretty sure that's not the kind of thing the black formatter would complain about - perhaps you also changed something else and caused a syntax error by accident?

  1. Thank you very much for the fixup. That's super helpful to see how you made the changes :)
  2. I am not very sure what I did that caused the 'black' to complain so much. I did notice sometimes exactly the same code on my VS code will fail the first time and pass the second time. I might need to re-install VS code at some point or just use the terminal instead.

Copy link
Member

@MarcoGorelli MarcoGorelli left a comment

Choose a reason for hiding this comment

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

Looks good to me, will leave open for a bit in case others have comments

@jreback jreback merged commit 7fe9217 into pandas-dev:master May 26, 2021
@jreback
Copy link
Contributor

jreback commented May 26, 2021

thanks @Jiezheng2018

@Jiezheng2018 Jiezheng2018 deleted the shiny-new-feature branch May 26, 2021 06:04
TLouf pushed a commit to TLouf/pandas that referenced this pull request Jun 1, 2021
JulianWgs pushed a commit to JulianWgs/pandas that referenced this pull request Jul 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Deprecate Functionality to remove in pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants