Skip to content

Commit 51c976c

Browse files
TomAugspurgerharisbal
authored and
harisbal
committed
Ignore warnings when reading pickle files (pandas-dev#19580)
1 parent 91c76cc commit 51c976c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pandas/io/pickle.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
""" pickle compat """
2+
import warnings
23

34
import numpy as np
45
from numpy.lib.format import read_array, write_array
@@ -96,7 +97,9 @@ def try_read(path, encoding=None):
9697
# cpickle
9798
# GH 6899
9899
try:
99-
return read_wrapper(lambda f: pkl.load(f))
100+
with warnings.catch_warnings(record=True):
101+
# We want to silencce any warnings about, e.g. moved modules.
102+
return read_wrapper(lambda f: pkl.load(f))
100103
except Exception:
101104
# reg/patched pickle
102105
try:

0 commit comments

Comments
 (0)