-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
BUG: Cannot read pickle generate_legacy_storage_files version 1.4.2 under environment pandas version 1.5.0 (incompatibilites issue) #47090
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
Comments
cc @jbrockmendel possibly related to Timestamp non-nano pickle changes |
This came up on another thread. I think the solution was to add a default value reso=NPY_FR_ns to _unpickle_timestamp |
It seems that this issue has come up again after using pandas 2.1.0. Using 2.0.3 still works fine so have reverted my pipeline to 2.0.3 awaiting a fix for 2.1.0. I couldn't find any changes to pickle in 2.1.0 mentioned in the release notes though. The error in my pipeline where my pytest now fails comparing a reference set stored in a pickle file, witth a new result:
|
@paulmadejong IIUC the fix here will be in Do note that pickle is not intended for long-term storage. We make an effort at cross-version compatibility, but the guy who was most enthusiastic about that is less active than he once was, so it is less of a priority than it once was. |
A fix would be appreciated but also, which format is recommended for long term |
I'm taking some time off so am unlikely to do it myself anytime soon. But if you'd like to make a PR go for it!
I'd suggest to_parquet/read_parquet |
Pandas version checks
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Use pandas version==1.4.2 python environment with current main version of the generate_legacy_storage_files (in https://github.com/pandas-dev/pandas/blob/main/pandas/tests/io/generate_legacy_storage_files.py) to generate pickle file.
Using pandas version==1.5.0.dev0+794.g4f92db3b5d to load pickle file,
Issue Description
The error is raised when read pickle pandas version==1.4.2 with pandas version=1.5.0.dev0+794.g4f92db3b5d
There is incompatibilities issues which this is picking up. (function needs to be made backwards compatible)
Expected Behavior
Able to read pickle pandas version==1.4.2 with pandas version=1.5.0.dev0+794.g4f92db3b5d.
Installed Versions
python : 3.9.7.final.0
python-bits : 64
OS : Linux
OS-release : 5.10.16.3-microsoft-standard-WSL2
Version : #1 SMP Fri Apr 2 22:23:49 UTC 2021
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : C.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.5.0.dev0+806.g7389a95737.dirty
numpy : 1.22.3
pytz : 2021.3
dateutil : 2.8.2
pip : 21.2.4
setuptools : 58.0.4
Cython : 0.29.24
pytest : 6.2.4
hypothesis : 6.42.0
sphinx : 4.2.0
blosc : None
feather : None
xlsxwriter : 3.0.1
lxml.etree : 4.6.3
html5lib : 1.1
pymysql : None
psycopg2 : None
jinja2 : 2.11.3
IPython : 7.29.0
pandas_datareader: None
bs4 : 4.10.0
bottleneck : 1.3.2
brotli :
fastparquet : None
fsspec : 2021.08.1
gcsfs : None
matplotlib : 3.4.3
numba : None
numexpr : 2.7.3
odfpy : None
openpyxl : 3.0.9
pandas_gbq : None
pyarrow : 7.0.0
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.7.1
snappy : None
sqlalchemy : 1.4.22
tables : 3.6.1
tabulate : None
xarray : None
xlrd : 2.0.1
xlwt : 1.3.0
zstandard : None
The text was updated successfully, but these errors were encountered: