-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
testing.assert_frame_equal obj parameter not always respected #27023
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
I don't think this is really intended as part of the API but sure seems like a reasonable change. Want to make a PR? |
Sure, I can issue a PR. It's my first time pulling/building/running the pandas project though, so it might take me a while to figure it out.
Out of curiosity, could you elaborate? Am I looking at this the wrong way, if I see this as a clear bug in the assertion message? |
I'm just looking at the docstring:
So never really intended for general purpose usage but I think simple enough to change based off research you've already done
Be sure to check out our contributing guide if you have not already: https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#contributing-to-pandas |
Thanks, looking at it now. Do you think the commit message prefix for this change should be |
TST works |
Code Sample
Problem description
In the first example where the column names differ, the 'myobj' label is used in the assertion message.
In the second example where the values differ, the 'myobj' label does not appear.
It looks to me like these strings should be formatted with
obj
instead of hardcoded withDataFrame
?https://github.com/pandas-dev/pandas/blob/master/pandas/util/testing.py#L1252
https://github.com/pandas-dev/pandas/blob/master/pandas/util/testing.py#L1267
Expected Output
I expected the assertion message for the second example to be:
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.7.1.final.0
python-bits: 64
OS: Linux
OS-release: 4.15.0-52-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_CA.UTF-8
LOCALE: en_CA.UTF-8
pandas: 0.24.2
pytest: 4.4.1
pip: 19.1
setuptools: 41.0.1
Cython: 0.29.7
numpy: 1.16.3
scipy: 1.2.1
pyarrow: None
xarray: None
IPython: 7.5.0
sphinx: 2.0.1
patsy: 0.5.1
dateutil: 2.8.0
pytz: 2019.1
blosc: None
bottleneck: 1.2.1
tables: 3.5.1
numexpr: 2.6.9
feather: None
matplotlib: 3.0.3
openpyxl: 2.6.1
xlrd: 1.2.0
xlwt: 1.3.0
xlsxwriter: 1.1.7
lxml.etree: 4.3.3
bs4: 4.7.1
html5lib: 1.0.1
sqlalchemy: 1.3.5
pymysql: None
psycopg2: None
jinja2: 2.10.1
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
gcsfs: None
The text was updated successfully, but these errors were encountered: