-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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
BUG: _validate_setitem_value fails to raise for PandasArray #51044
Comments
Just delete the |
it should raise ValueError/TypeError (not sure which off the top of my head), should match DTA/TDA etc behavior |
ah yes, it's set on a parent class as-is, so will have to raise here, of course. |
take |
Hi @topper-123, I am a beginner contributor. |
Hey @happyvignesh. Sounds great you want to contribute. What is needed here is adding a method called |
Hey @topper-123, `def _validate_setitem_value(self, value):
Could you please let me know if its fine. |
If you can find a way to ensure the new scalar is compatible with whatever numpy dtype is used, I think that is required also. I'm not sure ATM how'd you do that, but maybe you can find a way. |
Hi @topper-123 , instead of checking kind of data type, can we simply compare the data type itself? for example: PandasDtype(type(value)) == self.dtype As this will compare data type itself of current class and provide value's class. |
take |
if isinstance(value, str): This also works .Kindly let me know is this looks good .I made change in num_.py |
Suppose you are setting integer array and if you are calling below statement arr.setitem(arr,"foo") # <- fails to raise I tried and it worked |
take |
@kvnwng11 are you still working on this issue? |
@flaviaouyang Thanks for the ping! I am not still working, so I will unassign myself |
take |
is this actively being worked on? @flaviaouyang |
@yiorgosynkl no, go ahead |
take |
@yiorgosynkl are you currently working on this? |
@yiorgosynkl is this being worked on? |
take |
AFAICT this doesn't affect anything bc we always extract PandasArray before doing anything.
Note that if this did raise on 1.5, it might cause a problem with
arr.searchsorted(floats)
raising when we wouldn't want it to.The text was updated successfully, but these errors were encountered: