-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
CI/TST: Don't require length for construct_1d_arraylike_from_scalar cast to float64 #47393
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 10 commits
ceffe6d
d324332
cdcf033
1a82a00
e63d61e
536786f
106449d
2131095
df267f9
ffd1171
57d43c2
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 |
---|---|---|
|
@@ -1200,23 +1200,27 @@ def _maybe_coerce_merge_keys(self) -> None: | |
|
||
# check whether ints and floats | ||
elif is_integer_dtype(rk.dtype) and is_float_dtype(lk.dtype): | ||
if not (lk == lk.astype(rk.dtype))[~np.isnan(lk)].all(): | ||
warnings.warn( | ||
"You are merging on int and float " | ||
"columns where the float values " | ||
"are not equal to their int representation.", | ||
UserWarning, | ||
) | ||
# GH 47391 numpy > 1.24 will raise a RuntimeError for nan -> int | ||
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. for 1.5 we ought to actually remove the nans first 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. So in 1.5. add a deprecation noting that nans will be dropped? 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. no i mean i think u can remove the nans before comparing to avoid the warning (this is all internal anyhow) 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. Ah gotcha. Yeah can clean this for 1.5 in a separate PR |
||
with np.errstate(invalid="ignore"): | ||
if not (lk == lk.astype(rk.dtype))[~np.isnan(lk)].all(): | ||
warnings.warn( | ||
"You are merging on int and float " | ||
"columns where the float values " | ||
"are not equal to their int representation.", | ||
UserWarning, | ||
) | ||
continue | ||
|
||
elif is_float_dtype(rk.dtype) and is_integer_dtype(lk.dtype): | ||
if not (rk == rk.astype(lk.dtype))[~np.isnan(rk)].all(): | ||
warnings.warn( | ||
"You are merging on int and float " | ||
"columns where the float values " | ||
"are not equal to their int representation.", | ||
UserWarning, | ||
) | ||
# GH 47391 numpy > 1.24 will raise a RuntimeError for nan -> int | ||
with np.errstate(invalid="ignore"): | ||
if not (rk == rk.astype(lk.dtype))[~np.isnan(rk)].all(): | ||
warnings.warn( | ||
"You are merging on int and float " | ||
"columns where the float values " | ||
"are not equal to their int representation.", | ||
UserWarning, | ||
) | ||
continue | ||
|
||
# let's infer and see if we are ok | ||
|
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 think still need the length here as this part of the code is this logic to determine the the dtype
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.e. revert to original.