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

Ignore warnings when reading pickle files #19580

Merged
merged 3 commits into from
Feb 9, 2018

Conversation

TomAugspurger
Copy link
Contributor

Silences a warning from our tests about

pandas/tests/io/test_common.py::TestCommonIOCapabilities::()::test_read_fspath_all[reader10-os-/home/travis/build/pandas-dev/pandas/pandas/tests/io/data/categorical_0_14_1.pickle]
  /home/travis/build/pandas-dev/pandas/pandas/io/pickle.py:99: FutureWarning: 'pandas.core' is private. Use 'pandas.Categorical'
    return read_wrapper(lambda f: pkl.load(f))

Silences a warning from our tests about

```
pandas/tests/io/test_common.py::TestCommonIOCapabilities::()::test_read_fspath_all[reader10-os-/home/travis/build/pandas-dev/pandas/pandas/tests/io/data/categorical_0_14_1.pickle]
  /home/travis/build/pandas-dev/pandas/pandas/io/pickle.py:99: FutureWarning: 'pandas.core' is private. Use 'pandas.Categorical'
    return read_wrapper(lambda f: pkl.load(f))
```
@TomAugspurger TomAugspurger added Testing pandas testing functions or related to the test suite IO Data IO issues that don't fit into a more specific label CI Continuous Integration labels Feb 7, 2018
@TomAugspurger TomAugspurger added this to the 0.23.0 milestone Feb 7, 2018
@jreback
Copy link
Contributor

jreback commented Feb 7, 2018

we. an move up our pickle compat as well
i think we r at 0.13 maybe move to 0.17

maybe make a new issue for this

@TomAugspurger
Copy link
Contributor Author

TomAugspurger commented Feb 7, 2018 via email

@@ -96,7 +97,8 @@ def try_read(path, encoding=None):
# cpickle
# GH 6899
try:
return read_wrapper(lambda f: pkl.load(f))
with warnings.simplefilter('ignore'):
Copy link
Contributor

Choose a reason for hiding this comment

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

use catch_warnings

@codecov
Copy link

codecov bot commented Feb 8, 2018

Codecov Report

Merging #19580 into master will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #19580      +/-   ##
==========================================
+ Coverage   91.62%   91.62%   +<.01%     
==========================================
  Files         150      150              
  Lines       48773    48790      +17     
==========================================
+ Hits        44687    44703      +16     
- Misses       4086     4087       +1
Flag Coverage Δ
#multiple 89.99% <ø> (ø) ⬆️
#single 41.73% <ø> (-0.02%) ⬇️
Impacted Files Coverage Δ
pandas/core/indexes/category.py 97.26% <0%> (-0.26%) ⬇️
pandas/core/groupby.py 92.12% <0%> (-0.05%) ⬇️
pandas/core/sparse/frame.py 94.81% <0%> (ø) ⬆️
pandas/core/indexing.py 93.11% <0%> (ø) ⬆️
pandas/core/frame.py 97.42% <0%> (ø) ⬆️
pandas/core/generic.py 95.93% <0%> (+0.01%) ⬆️
pandas/core/reshape/merge.py 94.25% <0%> (+0.03%) ⬆️
pandas/core/arrays/categorical.py 94.87% <0%> (+0.13%) ⬆️

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 5052842...b0b37ff. Read the comment docs.

@@ -96,7 +97,9 @@ def try_read(path, encoding=None):
# cpickle
# GH 6899
try:
return read_wrapper(lambda f: pkl.load(f))
with warnings.catch_warnings():
warnings.simplefilter('ignore')
Copy link
Contributor

Choose a reason for hiding this comment

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

you don't need the simple filter

warnings.catch_warnings(record=True)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, I didn't know that.

@jreback jreback merged commit f30345f into pandas-dev:master Feb 9, 2018
@jreback
Copy link
Contributor

jreback commented Feb 9, 2018

thanks!

harisbal pushed a commit to harisbal/pandas that referenced this pull request Feb 28, 2018
@TomAugspurger TomAugspurger deleted the pickle-warning branch May 2, 2018 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Continuous Integration IO Data IO issues that don't fit into a more specific label Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants