Skip to content

Fix docstring of functions created with the deprecate() function #24215

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

Merged
merged 4 commits into from
Dec 13, 2018
Merged

Fix docstring of functions created with the deprecate() function #24215

merged 4 commits into from
Dec 13, 2018

Conversation

datapythonista
Copy link
Member

Functions created with deprecate function in pandas.util._decorators are causing us some problems, for example in #24188, as the docstring is created automatically, and the .. deprecate:: directive was added at the start. This PR fixes the docstring of the functions created with deprecate and adds tests to the function, as they were non-existent.

  • closes #xxxx
  • tests added / passed
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

@pep8speaks
Copy link

Hello @datapythonista! Thanks for submitting the PR.

@codecov
Copy link

codecov bot commented Dec 11, 2018

Codecov Report

Merging #24215 into master will decrease coverage by 49.2%.
The diff coverage is 81.81%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #24215       +/-   ##
===========================================
- Coverage   92.21%      43%   -49.21%     
===========================================
  Files         162      162               
  Lines       51763    51766        +3     
===========================================
- Hits        47733    22262    -25471     
- Misses       4030    29504    +25474
Flag Coverage Δ
#multiple ?
#single 43% <81.81%> (-0.01%) ⬇️
Impacted Files Coverage Δ
pandas/util/_decorators.py 68.22% <81.81%> (-23.13%) ⬇️
pandas/io/formats/latex.py 0% <0%> (-100%) ⬇️
pandas/core/categorical.py 0% <0%> (-100%) ⬇️
pandas/io/sas/sas_constants.py 0% <0%> (-100%) ⬇️
pandas/tseries/plotting.py 0% <0%> (-100%) ⬇️
pandas/tseries/converter.py 0% <0%> (-100%) ⬇️
pandas/io/formats/html.py 0% <0%> (-98.62%) ⬇️
pandas/core/groupby/categorical.py 0% <0%> (-95.46%) ⬇️
pandas/io/sas/sas7bdat.py 0% <0%> (-91.17%) ⬇️
pandas/io/sas/sas_xport.py 0% <0%> (-90.15%) ⬇️
... and 120 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 91802fb...cc29112. Read the comment docs.

@codecov
Copy link

codecov bot commented Dec 11, 2018

Codecov Report

Merging #24215 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #24215      +/-   ##
==========================================
+ Coverage   92.21%   92.21%   +<.01%     
==========================================
  Files         162      162              
  Lines       51763    51765       +2     
==========================================
+ Hits        47733    47735       +2     
  Misses       4030     4030
Flag Coverage Δ
#multiple 90.61% <100%> (ø) ⬆️
#single 43% <100%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/util/_decorators.py 91.5% <100%> (+0.16%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 91802fb...7315e63. Read the comment docs.


import pytest

from pandas.util._decorators import deprecate
Copy link
Contributor

Choose a reason for hiding this comment

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

are these inplace of tests_deprecate_kwarg.py? (this is pretty new)

Copy link
Member Author

Choose a reason for hiding this comment

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

No, they are different. We have an old (I guess) deprecate that is used to deprecate argmax (and argmin) with deprecate('argmax', idmax).

The function was not tested, and I had to modify it, because it was injecting the .. deprecate:: directive in a way that the docstring format was wrong.

@jreback jreback added this to the 0.24.0 milestone Dec 11, 2018
@jreback
Copy link
Contributor

jreback commented Dec 11, 2018

lgtm. @jorisvandenbossche or @TomAugspurger

@TomAugspurger
Copy link
Contributor

LGTM, thanks.

@TomAugspurger TomAugspurger merged commit d43ac97 into pandas-dev:master Dec 13, 2018
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
…das-dev#24215)

* Fix docstring of functions created with the deprecate() function

* Allowing deprecate to be used with functions without docstring
Pingviinituutti pushed a commit to Pingviinituutti/pandas that referenced this pull request Feb 28, 2019
…das-dev#24215)

* Fix docstring of functions created with the deprecate() function

* Allowing deprecate to be used with functions without docstring
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants