-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
MagicMock a pandas DataFrame causes a segfault #25332
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
A very odd regression indeed, but a regression nonetheless and for a reasonable intention IMO. |
cc @jreback This stems from #24541 in which The breaking logic is here: https://github.com/pandas-dev/pandas/blob/659e0ca/pandas/core/dtypes/common.py#L2036-L2043 Unfortunately, from unittest.mock import MagicMock
import numpy as np
np.dtype(MagicMock()) @roachlord : Perhaps this might be worthwhile to bring up as an issue on the |
this is not supported in any way; it may have happened to work before |
@jreback : Fair enough. 👍 @roachlord : I see you are making some headway with your issue to |
Doesn't appear to be an issue on master so I think OK to close this one |
Code Sample
Problem description
I have a function that returns a column of dataframe. I want to mock out this function and test it is called with the correct args. The above code segs outs in 0.24.1 but not in 0.23.4.
Expected Output
Not to seg fault
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 2.7.12.final.0
python-bits: 64
OS: Linux
OS-release: 4.4.0-142-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US
LOCALE: None.None
pandas: 0.24.1
pytest: None
pip: 19.0.2
setuptools: 40.8.0
Cython: None
numpy: 1.16.1
scipy: 1.2.1
pyarrow: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.8.0
pytz: 2018.9
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: None
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml.etree: None
bs4: None
html5lib: None
sqlalchemy: 1.2.17
pymysql: None
psycopg2: 2.7.7 (dt dec pq3 ext lo64)
jinja2: None
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None
The text was updated successfully, but these errors were encountered: