-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Allow read_pickle to accept file-like objects #29054
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
We would need a self-contained, reproducible example http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports |
Alright, here is just the bare bones of it:
I checked, it's giving me the error. Moreover, the portalocker isn't really important and doesn't change anything, the following also gives the same error:
|
The docs for
Maybe this could be an enhancement, but in terms of currently documented behavior, I think getting an error is expected. Although maybe the error thrown should be a bit more precise |
Good catch @asishm. Currently |
It also worked before, so whatever it was doing before, could it be reimplemented? |
how so? this was never implemented |
To be honest, now that I know I'm surprised too, but my code only stopped working when I updated pandas. |
I have the same with s3 files: I used to open them with |
Code Sample, a copy-pastable example if possible
Alternatively, a more concise, self-contained, reproducible example:
Replace
portalocker.Lock
withopen(path, 'rb+')
and you get the same thing.Problem description
The above used to work. However, having updated to the latest pandas version recently (0.25.1), it now produces an error on the
pd.read_pickle
, and based on other issues, it will also produce an error ondf.to_pickle()
if it gets that far. Am I doing it wrong or should I do it differently, or it is just a bug?The error traceback is:
Expected Output
Output of
pd.show_versions()
This didn't work as it couldn't determine the version for pip for some reason (I have pip, I'm not sure what's going on here), but the pandas version I'm running is: 0.25.1
On my other machine, which also has the error:
INSTALLED VERSIONS
commit : None
python : 3.6.8.final.0
python-bits : 64
OS : Linux
OS-release : 4.18.16-041816-generic
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_GB.UTF-8
LOCALE : en_GB.UTF-8
pandas : 0.25.1
numpy : 1.14.3
pytz : 2018.4
dateutil : 2.7.3
pip : 19.1.1
setuptools : 39.1.0
Cython : 0.28.2
pytest : 3.5.1
hypothesis : None
sphinx : 1.7.4
blosc : None
feather : None
xlsxwriter : 1.0.4
lxml.etree : 4.2.1
html5lib : 1.0.1
pymysql : None
psycopg2 : None
jinja2 : 2.10
IPython : 6.4.0
pandas_datareader: None
bs4 : 4.6.0
bottleneck : 1.2.1
fastparquet : None
gcsfs : None
lxml.etree : 4.2.1
matplotlib : 3.1.1
numexpr : 2.6.5
odfpy : None
openpyxl : 2.5.3
pandas_gbq : None
pyarrow : None
pytables : None
s3fs : None
scipy : 1.1.0
sqlalchemy : 1.2.7
tables : 3.4.3
xarray : None
xlrd : 1.1.0
xlwt : 1.3.0
xlsxwriter : 1.0.4
The text was updated successfully, but these errors were encountered: