-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
Conversation
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)) ```
we. an move up our pickle compat as well maybe make a new issue for this |
… On Wed, Feb 7, 2018 at 11:46 AM, Jeff Reback ***@***.***> wrote:
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
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#19580 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABQHIh8lxoVwV9aTbNjTTZV3W53DqsqKks5tSeF1gaJpZM4R9HUX>
.
|
pandas/io/pickle.py
Outdated
@@ -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'): |
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.
use catch_warnings
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
pandas/io/pickle.py
Outdated
@@ -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') |
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.
you don't need the simple filter
warnings.catch_warnings(record=True)
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.
Oh, I didn't know that.
thanks! |
Silences a warning from our tests about