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

Correctly re-instate Matplotlib converters #27481

Merged
merged 4 commits into from Aug 20, 2019

Conversation

dstansby
Copy link
Contributor

Fixes #27479. Converters should only be cached to be re-instated if they are original, and not pandas converters.

I'm struggling to write a test for this; I think it requires a clean state with no pandas imports, so one can check what was in the units registry before pandas was imported. I think this means a new test file with no pandas imports at the top, but maybe someone has a better idea?

@TomAugspurger
Copy link
Contributor

Thanks for this!

I'm struggling to write a test for this;

Testing these is quite hard (we accidentally broke the warning for a release and didn't notice).

def test_initial_warning():
works reasonably well I think. The idea is to run the check in a subprocess.

@TomAugspurger TomAugspurger added this to the 0.25.1 milestone Jul 19, 2019
@TomAugspurger TomAugspurger added the Visualization plotting label Jul 19, 2019
@TomAugspurger
Copy link
Contributor

A release note in whatsnew/0.25.1.rst would be nice to have. I think there's a "plotting" subsection.

@codecov
Copy link

codecov bot commented Jul 19, 2019

Codecov Report

Merging #27481 into master will increase coverage by 49.17%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #27481       +/-   ##
===========================================
+ Coverage   42.44%   91.62%   +49.17%     
===========================================
  Files         184      184               
  Lines       50389    50388        -1     
===========================================
+ Hits        21389    46167    +24778     
+ Misses      29000     4221    -24779
Flag Coverage Δ
#multiple 91.62% <100%> (?)
#single ?
Impacted Files Coverage Δ
pandas/plotting/_matplotlib/converter.py 63.64% <100%> (+49.94%) ⬆️
pandas/core/computation/pytables.py 63.71% <0%> (-26.22%) ⬇️
pandas/io/pytables.py 65.55% <0%> (-23.83%) ⬇️
pandas/io/clipboard/clipboards.py 31.88% <0%> (-2.9%) ⬇️
pandas/util/_test_decorators.py 93.84% <0%> (+4.61%) ⬆️
pandas/io/gbq.py 88.88% <0%> (+5.55%) ⬆️
pandas/_config/localization.py 86% <0%> (+6%) ⬆️
pandas/core/dtypes/inference.py 100% <0%> (+13.33%) ⬆️
pandas/compat/numpy/__init__.py 93.1% <0%> (+13.79%) ⬆️
pandas/core/config_init.py 96.2% <0%> (+13.92%) ⬆️
... and 138 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 9bab81e...9589b8f. Read the comment docs.

@dstansby
Copy link
Contributor Author

Thanks for the test tip, the new test fails before the changes in this PR.

doc/source/whatsnew/v0.25.1.rst Show resolved Hide resolved
pandas/plotting/_matplotlib/converter.py Outdated Show resolved Hide resolved
pandas/tests/plotting/test_converter.py Outdated Show resolved Hide resolved
@dstansby dstansby force-pushed the mpl-convert-cache branch 2 times, most recently from ad83bef to 81ec586 Compare July 20, 2019 17:56
Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

also pls merge master

doc/source/whatsnew/v0.25.1.rst Outdated Show resolved Hide resolved
@dstansby
Copy link
Contributor Author

I'm away for the next week or so without a computer, so if anyone wants this in quicker than that feel free to force push to my branch.

@dstansby
Copy link
Contributor Author

dstansby commented Aug 5, 2019

Is there anything else (apart from a rebase) I need to do on this?

Copy link
Contributor

@TomAugspurger TomAugspurger 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. Ping on green.

@TomAugspurger
Copy link
Contributor

Did you merge master before pushing? We've seen similar CI failures, but I thought we fixed them all on master.

@dstansby
Copy link
Contributor Author

dstansby commented Aug 6, 2019

Yeah, I should have rebased on to master, I've done another rebase to see if that fixes the tests.

@TomAugspurger
Copy link
Contributor

Merged master again to see if we can get the CI passing.

@TomAugspurger TomAugspurger merged commit e55b698 into pandas-dev:master Aug 20, 2019
@TomAugspurger
Copy link
Contributor

Thanks @dstansby. Sorry about the CI issues.

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.

deregister_matplotlib_converters() in 0.25 incorrectly removes Matplotlib converters
3 participants