@@ -2067,14 +2067,6 @@ def test_get_loc_multi_numeric_deviate(idx, key, result):
2067
2067
assert_eq (expected , got )
2068
2068
2069
2069
2070
- @pytest .mark .parametrize (
2071
- "idx" ,
2072
- [
2073
- pd .MultiIndex .from_tuples (
2074
- [(2 , 1 , 1 ), (1 , 2 , 3 ), (1 , 2 , 1 ), (1 , 1 , 10 ), (1 , 1 , 1 ), (2 , 2 , 1 )]
2075
- )
2076
- ],
2077
- )
2078
2070
@pytest .mark .parametrize (
2079
2071
"key" ,
2080
2072
[
@@ -2084,21 +2076,42 @@ def test_get_loc_multi_numeric_deviate(idx, key, result):
2084
2076
],
2085
2077
)
2086
2078
@pytest .mark .parametrize ("method" , [None , "ffill" , "bfill" ])
2087
- def test_get_indexer_multi_numeric_deviate (request , idx , key , method ):
2088
- pi = idx
2079
+ def test_get_indexer_multi_numeric_deviate (key , method ):
2080
+ pi = pd .MultiIndex .from_tuples (
2081
+ [(2 , 1 , 1 ), (1 , 2 , 3 ), (1 , 2 , 1 ), (1 , 1 , 10 ), (1 , 1 , 1 ), (2 , 2 , 1 )]
2082
+ ).sort_values ()
2089
2083
gi = cudf .from_pandas (pi )
2090
- request .applymarker (
2091
- pytest .mark .xfail (
2092
- condition = method is not None and key == ((1 , 2 , 3 ),),
2093
- reason = "https://github.com/pandas-dev/pandas/issues/53452" ,
2094
- )
2095
- )
2084
+
2096
2085
expected = pi .get_indexer (key , method = method )
2097
2086
got = gi .get_indexer (key , method = method )
2098
2087
2099
2088
assert_eq (expected , got )
2100
2089
2101
2090
2091
+ @pytest .mark .xfail (
2092
+ not PANDAS_GE_220 , reason = "Remove after pandas-2.2+ upgrade"
2093
+ )
2094
+ @pytest .mark .parametrize ("method" , ["ffill" , "bfill" ])
2095
+ def test_get_indexer_multi_error (method ):
2096
+ pi = pd .MultiIndex .from_tuples (
2097
+ [(2 , 1 , 1 ), (1 , 2 , 3 ), (1 , 2 , 1 ), (1 , 1 , 10 ), (1 , 1 , 1 ), (2 , 2 , 1 )]
2098
+ )
2099
+ gi = cudf .from_pandas (pi )
2100
+
2101
+ assert_exceptions_equal (
2102
+ pi .get_indexer ,
2103
+ gi .get_indexer ,
2104
+ lfunc_args_and_kwargs = (
2105
+ [],
2106
+ {"target" : ((1 , 2 , 3 ),), "method" : method },
2107
+ ),
2108
+ rfunc_args_and_kwargs = (
2109
+ [],
2110
+ {"target" : ((1 , 2 , 3 ),), "method" : method },
2111
+ ),
2112
+ )
2113
+
2114
+
2102
2115
@pytest .mark .parametrize (
2103
2116
"idx" ,
2104
2117
[
@@ -3094,7 +3107,7 @@ def test_index_with_index_dtype(data, dtype):
3094
3107
3095
3108
3096
3109
def test_period_index_error ():
3097
- pidx = pd .PeriodIndex (year = [ 2000 , 2002 ], quarter = [ 1 , 3 ])
3110
+ pidx = pd .PeriodIndex (data = [ pd . Period ( "2020-01" ) ])
3098
3111
with pytest .raises (NotImplementedError ):
3099
3112
cudf .from_pandas (pidx )
3100
3113
with pytest .raises (NotImplementedError ):
0 commit comments