From 1ba5cf8e4f417877cb39801267648d2f423cd9b8 Mon Sep 17 00:00:00 2001 From: phofl Date: Sat, 7 Nov 2020 23:32:34 +0100 Subject: [PATCH 1/2] TST: Add test for 25927 --- pandas/tests/indexing/test_loc.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pandas/tests/indexing/test_loc.py b/pandas/tests/indexing/test_loc.py index 3b0fae537a6e5..dd99f11a668ac 100644 --- a/pandas/tests/indexing/test_loc.py +++ b/pandas/tests/indexing/test_loc.py @@ -1512,6 +1512,16 @@ def test_series_loc_getitem_label_list_missing_values(): s.loc[key] +def test_series_getitem_label_list_missing_integer_values(): + # GH: 25927 + s = pd.Series( + index=np.array([9730701000001104, 10049011000001109]), + data=np.array([999000011000001104, 999000011000001104]), + ) + with pytest.raises(KeyError, match="with any missing labels"): + s.loc[np.array([9730701000001104, 10047311000001102])] + + @pytest.mark.parametrize( "columns, column_key, expected_columns, check_column_type", [ From 44f46208514d801d350edbfe4b98f36d5a328820 Mon Sep 17 00:00:00 2001 From: phofl Date: Sun, 8 Nov 2020 00:04:54 +0100 Subject: [PATCH 2/2] Fix pattern --- pandas/tests/indexing/test_loc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/tests/indexing/test_loc.py b/pandas/tests/indexing/test_loc.py index dd99f11a668ac..0faa784634fd2 100644 --- a/pandas/tests/indexing/test_loc.py +++ b/pandas/tests/indexing/test_loc.py @@ -1514,7 +1514,7 @@ def test_series_loc_getitem_label_list_missing_values(): def test_series_getitem_label_list_missing_integer_values(): # GH: 25927 - s = pd.Series( + s = Series( index=np.array([9730701000001104, 10049011000001109]), data=np.array([999000011000001104, 999000011000001104]), )