Skip to content

Conversation

rhshadrach
Copy link
Member

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

Ref: #59615

The default of na in these methods was changed from None to no_default in #59616; I am assuming we want to stick with no_default.

@rhshadrach rhshadrach added Error Reporting Incorrect or improved errors from pandas Strings String extension data type and string data Clean labels Sep 21, 2025
return
if isna(value):
return
raise ValueError(f"{name} must be a valid NA value; got {value}")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
raise ValueError(f"{name} must be a valid NA value; got {value}")
raise ValueError(f"{name} must be a bool (True/False) or a valid NA value; got {value}")

Copy link
Member

Choose a reason for hiding this comment

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

BTW, I don't know if there is a case for which you are foreseeing allow_no_default and allow_bool to be used, but if they would actually be used, then the error message would also have to be updated to follow that.

(so for now could also simplify things leaving out the keywords?)

Copy link
Member Author

@rhshadrach rhshadrach Sep 22, 2025

Choose a reason for hiding this comment

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

How would you feel about ...must be a valid value; got {value}?

Copy link
Member

Choose a reason for hiding this comment

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

I personally think it is useful to give an indication about what a valid value is (or say "a valid value for dtype ..", so then if it is bool, then it is clearer that it should be True/False or a missing value (for nullable bool)?)

@rhshadrach rhshadrach changed the title CLN: Enforce deprecation of not validating argument CLN: Enforce deprecation of not validating na argument to string methods Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Error Reporting Incorrect or improved errors from pandas Strings String extension data type and string data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants