Skip to content

BUG: GH35865 - int cast to str with colon setitem #41077

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

Merged
merged 3 commits into from
Apr 26, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pandas/tests/indexing/test_coercion.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ def test_setitem_series_timedelta64(self, val, exp_dtype):
)
self._assert_setitem_series_conversion(obj, val, exp, exp_dtype)

def test_setitem_series_no_coercion_from_values_list(self):
# GH35865 - int casted to str when internally calling np.array(ser.values)
ser1 = pd.Series(["a", 1])
ser2 = pd.Series(["a", 1])
ser2[:] = list(ser2.values)

tm.assert_series_equal(ser1, ser2)

def _assert_setitem_index_conversion(
self, original_series, loc_key, expected_index, expected_dtype
):
Expand Down