Skip to content
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

API: consistently raise TypeError for invalid-typed fill_value #37733

Merged
merged 4 commits into from
Nov 13, 2020

Conversation

jbrockmendel
Copy link
Member

  • closes #xxxx
  • tests added / passed
  • passes black pandas
  • passes git diff upstream/master -u -- "*.py" | flake8 --diff
  • whatsnew entry

This makes us consistent about raising TypeError when passing a wrong-typed fill_value to e.g. take. The downside is that we changed Categorical.take from TypeError to ValueError back in 1.1.0 #33660, so theres a bit of whiplash.

The upside (besides this just being More Correct) is that we will be just about fully sharing setitem-like validator methods.

@WillAyd WillAyd added Error Reporting Incorrect or improved errors from pandas Indexing Related to indexing on series/frames, not to indexes themselves labels Nov 10, 2020
@WillAyd
Copy link
Member

WillAyd commented Nov 10, 2020

Yea the back and forth is unfortunate, but I agree this seems more correct. Could use a whatsnew note

@jreback jreback added this to the 1.2 milestone Nov 13, 2020
@jreback jreback merged commit 68f53cd into pandas-dev:master Nov 13, 2020
@jreback
Copy link
Contributor

jreback commented Nov 13, 2020

thanks

@jbrockmendel jbrockmendel deleted the ref-validate_fill_value branch November 14, 2020 04:22
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 Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants