Skip to content

change merge validate errors to MergeError from ValueError #16436

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

Merged

Conversation

nickeubank
Copy link
Contributor

Final changes from #16275 that failed to push before merge. Converts errors from validate argument of merge command to MergeErrors from ValueErrors.

@TomAugspurger
Copy link
Contributor

@nickeubank would you mind moving the MergeError definition to pandas/errors/__init__.py (and adding a docstring), then importing it where needed. A bit more consistent (though I know you didn't add it).

@TomAugspurger TomAugspurger added this to the 0.21.0 milestone May 22, 2017
@TomAugspurger TomAugspurger added Error Reporting Incorrect or improved errors from pandas Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels May 22, 2017
@TomAugspurger
Copy link
Contributor

You might have to update the tests in pandas/tests/api/test_api.py FYI

@codecov
Copy link

codecov bot commented May 22, 2017

Codecov Report

Merging #16436 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #16436   +/-   ##
=======================================
  Coverage   90.42%   90.42%           
=======================================
  Files         161      161           
  Lines       51023    51023           
=======================================
  Hits        46138    46138           
  Misses       4885     4885
Flag Coverage Δ
#multiple 88.26% <100%> (ø) ⬆️
#single 40.17% <0%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/core/reshape/merge.py 94.19% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 49ec31b...de06397. Read the comment docs.

@codecov
Copy link

codecov bot commented May 22, 2017

Codecov Report

Merging #16436 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #16436   +/-   ##
=======================================
  Coverage   90.42%   90.42%           
=======================================
  Files         161      161           
  Lines       51023    51023           
=======================================
  Hits        46138    46138           
  Misses       4885     4885
Flag Coverage Δ
#multiple 88.26% <100%> (ø) ⬆️
#single 40.17% <28.57%> (ø) ⬆️
Impacted Files Coverage Δ
pandas/errors/__init__.py 100% <100%> (ø) ⬆️
pandas/core/reshape/merge.py 94.18% <100%> (-0.01%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 49ec31b...681a66d. Read the comment docs.

@nickeubank
Copy link
Contributor Author

nickeubank commented May 22, 2017

@TomAugspurger Migrated, but what would a test for this look like? Don't see any tests for the other errors in errors/__init__.py so not sure of right model.

Error raised when problems arise during merging due to problems
with input data. Subclass of `ValueError`.

.. versionadded:: 0.21.0
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this versionadded, it was added quite a long time ago

@nickeubank nickeubank force-pushed the change_error_to_mergeerror branch from de06397 to b1f2225 Compare May 22, 2017 22:43
@jreback
Copy link
Contributor

jreback commented May 22, 2017

https://github.com/pandas-dev/pandas/blob/master/pandas/tests/test_errors.py

these are really tested that well
mainly overall integration tests (e.g. we use them)
so i think prob ok

just make a note that we moved it

@nickeubank nickeubank force-pushed the change_error_to_mergeerror branch from b1f2225 to d129cfa Compare May 22, 2017 22:55
@nickeubank
Copy link
Contributor Author

@jreback thanks. Added to test_errors and squashed.

@jreback
Copy link
Contributor

jreback commented May 23, 2017

can you add a note in whatsnew (Other API Changes section is fine). otherwise lgtm. ping on green.

@nickeubank nickeubank force-pushed the change_error_to_mergeerror branch from d129cfa to 8dba88f Compare May 23, 2017 00:35
@jorisvandenbossche jorisvandenbossche merged commit a985dda into pandas-dev:master May 23, 2017
@jorisvandenbossche
Copy link
Member

@nickeubank Thanks!

stangirala pushed a commit to stangirala/pandas that referenced this pull request Jun 11, 2017
…v#16436)

* change merge validate errors to MergeError from ValueError
* move MergeError to pandas/errors
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 Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants