Skip to content

Commit de0579b

Browse files
add test
1 parent 3669711 commit de0579b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/tests/indexing/test_loc.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2869,6 +2869,13 @@ def test_loc_setitem_using_datetimelike_str_as_index(fill_val, exp_dtype):
28692869
tm.assert_index_equal(df.index, expected_index, exact=True)
28702870

28712871

2872+
def test_loc_set_int_dtype():
2873+
df = pd.DataFrame([list('abc')])
2874+
df.loc[:, 'col1'] = int(5)
2875+
2876+
assert str(df.dtypes['col1']) == 'int64'
2877+
2878+
28722879
class TestLocSeries:
28732880
@pytest.mark.parametrize("val,expected", [(2**63 - 1, 3), (2**63, 4)])
28742881
def test_loc_uint64(self, val, expected):

0 commit comments

Comments
 (0)