Skip to content

Commit fcfaf78

Browse files
authored
pd.Series.loc.__getitem__ promotes to float64 instead of raising KeyError (#37687)
1 parent a70144e commit fcfaf78

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/tests/indexing/test_loc.py

+10
Original file line numberDiff line numberDiff line change
@@ -1512,6 +1512,16 @@ def test_series_loc_getitem_label_list_missing_values():
15121512
s.loc[key]
15131513

15141514

1515+
def test_series_getitem_label_list_missing_integer_values():
1516+
# GH: 25927
1517+
s = Series(
1518+
index=np.array([9730701000001104, 10049011000001109]),
1519+
data=np.array([999000011000001104, 999000011000001104]),
1520+
)
1521+
with pytest.raises(KeyError, match="with any missing labels"):
1522+
s.loc[np.array([9730701000001104, 10047311000001102])]
1523+
1524+
15151525
@pytest.mark.parametrize(
15161526
"columns, column_key, expected_columns, check_column_type",
15171527
[

0 commit comments

Comments
 (0)