-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG FIX: incorrect type when casting to nullable type in multiindex dataframe #47419
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
Conversation
@@ -227,3 +227,17 @@ def test_multiindex_repeated_keys(self): | |||
], | |||
Series([1, 1, 2, 2], MultiIndex.from_arrays([["a", "a", "b", "b"]])), | |||
) | |||
|
|||
@pytest.mark.parametrize("data_type", ["int64", "int32", "float64", "float32"]) |
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 this should use any_signed_int_ea_dtype
@@ -11917,6 +11917,11 @@ def _reindex_for_setitem(value: DataFrame | Series, index: Index) -> ArrayLike: | |||
# reindex if necessary | |||
|
|||
if value.index.equals(index) or not len(index): | |||
if isinstance(value, DataFrame): | |||
dtype_list = value.dtypes.unique() |
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 this should use find_common_type
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.
Ok I will close my PR. Your PR is much better. Will look at your solution. |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.