Skip to content

Commit 57f828a

Browse files
address comments
1 parent 05abdbe commit 57f828a

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

tests/integ/modin/frame/test_pop.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import numpy as np
1010
import modin.pandas as pd
1111
import pandas as native_pd
12+
import pytest
1213

1314
from tests.integ.modin.utils import assert_frame_equal, assert_series_equal
1415
from tests.integ.utils.sql_counter import sql_count_checker
@@ -32,3 +33,20 @@ def test_pop():
3233

3334
assert_series_equal(snow_popped_ser, native_popped_ser)
3435
assert_frame_equal(snow_df, native_df)
36+
37+
38+
@sql_count_checker(query_count=0)
39+
def test_pop_not_found():
40+
native_df = native_pd.DataFrame(
41+
[
42+
("falcon", "bird", 389.0),
43+
("parrot", "bird", 24.0),
44+
("lion", "mammal", 80.5),
45+
("monkey", "mammal", np.nan),
46+
],
47+
columns=("name", "class", "max_speed"),
48+
)
49+
snow_df = pd.DataFrame(native_df)
50+
51+
with pytest.raises(KeyError):
52+
snow_df.pop("not_found")

tests/integ/modin/series/test_pop.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import modin.pandas as pd
1010
import pandas as native_pd
11+
import pytest
1112

1213
from tests.integ.modin.utils import assert_series_equal
1314
from tests.integ.utils.sql_counter import sql_count_checker
@@ -24,3 +25,13 @@ def test_pop():
2425

2526
assert snow_popped_val == native_popped_val
2627
assert_series_equal(snow_ser, native_ser)
28+
29+
30+
@sql_count_checker(query_count=2, join_count=1)
31+
def test_pop_not_found():
32+
native_ser = native_pd.Series([1, 2, 3])
33+
snow_ser = pd.Series(native_ser)
34+
assert isinstance(snow_ser, pd.Series)
35+
36+
with pytest.raises(KeyError):
37+
snow_ser.pop(-1)

0 commit comments

Comments
 (0)