Skip to content

ENH: Improved error message (issue 13084) #13187

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

Closed
wants to merge 1 commit into from

Conversation

gregsifr
Copy link

As per issue 13084, made it clearer for the user to understand why a concat failed. No additional code was needed. This is because the _verify_integrity method inside the BlockManager class of pandas/core/internals.py already checked that the length of the concat data and index are the same. An alternative option was to pass the error in the e argument of the construction_error method of the SingleBlockManager. The alternative was not performed as there appeared to be no other reason why the shape of the dataframes would be different, as a result using the e argument would result in duplicating code. The method was also not extended to identify the dataframes with duplicate index values to avoid overcomplicating the code. The end user should be able to easily identify the dataframe/s causing the errors

As per issue 13084, made it clearer for the user to understand why a concat failed. No additional code was needed. This is because the _verify_integrity method inside the BlockManager class of pandas/core/internals.py already checked that the length of the concat data and index are the same. An alternative option was to pass the error in the e argument of the construction_error method of the SingleBlockManager. The alternative was not performed as there appeared to be no other reason why the shape of the dataframes would be different, as a result using the e argument would result in duplicating code. The method was also not extended to identify the dataframes with duplicate index values to avoid overcomplicating the code. The end user should be able to easily identify the dataframe/s causing the errors
@jreback jreback added the Error Reporting Incorrect or improved errors from pandas label May 15, 2016
raise ValueError("Shape of passed values is {0}, indices imply {1}".format(
passed, implied))
raise ValueError("Shape of passed values is {0}, indices imply {1}.\n\
This means that at least one of the dataframes contains duplicate \
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not true at all, this error could be called for quite a few reasons. pls put the error more specifially (e.g. in merge.py) and test if there are duplicates.

@jreback
Copy link
Contributor

jreback commented May 31, 2016

if you'd like to update, pls reopen the issue.

@jreback jreback closed this May 31, 2016
@jorisvandenbossche jorisvandenbossche added this to the No action milestone Mar 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Error Reporting Incorrect or improved errors from pandas
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ERR: concat of non-unique join axes should have better error
3 participants