-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
CLN/TST: delegate StringArray.fillna() to parent class + add tests #37987
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
Changes from 2 commits
e6a3f40
0a85704
4814614
7051e97
df8e185
43a6646
616a6c7
a43de61
f6eff15
24cb928
9b2f918
a014784
02ff905
b658791
135f55a
ef1f800
719d3cd
f1489c7
0e84df8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -283,7 +283,8 @@ def __setitem__(self, key, value): | |
super().__setitem__(key, value) | ||
|
||
def fillna(self, value=None, method=None, limit=None): | ||
# TODO: validate dtype | ||
if not isinstance(value, str): | ||
raise TypeError(f"{value} is not a valid fill value; must be a string") | ||
return super().fillna(value, method, limit) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. does this method need to be overriden here at all? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it doesn't There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pushed that now |
||
|
||
def astype(self, dtype, copy=True): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
np.str_?
its a weird usage, but there's no reason why a user couldn't pass a n NA fill value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added both, including the missing value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
np.str_
is already be covered by str (it subclasses str):There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah right. Got rid of the
np.str_
check