ENH: Improved error message (issue 13084) #13187
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
git diff upstream/master | flake8 --diff
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