-
-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
TST: restore type checks to maybe_promote tests #28561
Conversation
casted = dtype.type(value) | ||
if casted == value: | ||
return True | ||
return False |
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.
Why not just return dtype.type(value) == 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.
Either way would work. I think in future steps this function is going to have to check a couple more things.
Co-Authored-By: gfyoung <gfyoung17+GitHub@gmail.com>
@@ -366,6 +367,8 @@ def maybe_promote(dtype, fill_value=np.nan): | |||
elif is_bool(fill_value): | |||
if not issubclass(dtype.type, np.bool_): | |||
dtype = np.object_ | |||
else: | |||
fill_value = np.bool_(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.
you added some code here but are these actually hit?
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.
i see you have another PR on top; can you just do them in one
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.
you added some code here but are these actually hit?
Yes. All the changes to the non-test code are needed to make the changes in the test code pass.
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.
i see you have another PR on top; can you just do them in one
Sure. Just close this and move conversation there?
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.
yeah let's just do it in one
Closing in favor of #28564. |
xref #25425. Working on fixing the xfailed tests in this file. This is going to be a marathon.