@@ -5923,7 +5923,7 @@ def test_dataframe_explode_xfail(col_names):
59235923 ),
59245924 ],
59255925)
5926- def test__resample_with_column (
5926+ def test_resample_with_column (
59275927 scalars_df_index , scalars_pandas_df_index , on , rule , origin
59285928):
59295929 # TODO: supply a reason why this isn't compatible with pandas 1.x
@@ -5943,30 +5943,51 @@ def test__resample_with_column(
59435943 )
59445944
59455945
5946+ @pytest .mark .parametrize ("index_col" , ["timestamp_col" , "datetime_col" ])
59465947@pytest .mark .parametrize (
5947- ("append" , "level" , "col" , "rule" ),
5948+ ("index_append" , "level" ),
5949+ [(True , 1 ), (False , None ), (False , 0 )],
5950+ )
5951+ @pytest .mark .parametrize (
5952+ "rule" ,
59485953 [
5949- pytest . param ( False , None , "timestamp_col" , "100d" ),
5950- pytest . param ( True , 1 , "timestamp_col" , "1200h" ) ,
5951- pytest . param ( False , None , "datetime_col" , "100d" ) ,
5954+ # TODO(tswast): support timedeltas and dataoffsets
5955+ "100d" ,
5956+ "1200h" ,
59525957 ],
59535958)
5954- def test__resample_with_index (
5955- scalars_df_index , scalars_pandas_df_index , append , level , col , rule
5959+ @pytest .mark .parametrize ("closed" , ["left" , "right" , None ])
5960+ @pytest .mark .parametrize ("label" , ["left" , "right" , None ])
5961+ @pytest .mark .parametrize (
5962+ "origin" ,
5963+ ["epoch" , "start" , "start_day" , "end" , "end_day" ],
5964+ )
5965+ def test_resample_with_index (
5966+ scalars_df_index ,
5967+ scalars_pandas_df_index ,
5968+ index_append ,
5969+ level ,
5970+ index_col ,
5971+ rule ,
5972+ closed ,
5973+ origin ,
5974+ label ,
59565975):
59575976 # TODO: supply a reason why this isn't compatible with pandas 1.x
59585977 pytest .importorskip ("pandas" , minversion = "2.0.0" )
5959- scalars_df_index = scalars_df_index .set_index (col , append = append )
5960- scalars_pandas_df_index = scalars_pandas_df_index .set_index (col , append = append )
5978+ scalars_df_index = scalars_df_index .set_index (index_col , append = index_append )
5979+ scalars_pandas_df_index = scalars_pandas_df_index .set_index (
5980+ index_col , append = index_append
5981+ )
59615982 bf_result = (
59625983 scalars_df_index [["int64_col" , "int64_too" ]]
5963- ._resample (rule = rule , level = level )
5984+ .resample (rule = rule , level = level , closed = closed , origin = origin , label = label )
59645985 .min ()
59655986 .to_pandas ()
59665987 )
59675988 pd_result = (
59685989 scalars_pandas_df_index [["int64_col" , "int64_too" ]]
5969- .resample (rule = rule , level = level )
5990+ .resample (rule = rule , level = level , closed = closed , origin = origin , label = label )
59705991 .min ()
59715992 )
59725993 assert_pandas_df_equal (bf_result , pd_result )
@@ -6010,7 +6031,7 @@ def test__resample_with_index(
60106031 ),
60116032 ],
60126033)
6013- def test__resample_start_time (rule , origin , data ):
6034+ def test_resample_start_time (rule , origin , data ):
60146035 # TODO: supply a reason why this isn't compatible with pandas 1.x
60156036 pytest .importorskip ("pandas" , minversion = "2.0.0" )
60166037 col = "timestamp_col"
0 commit comments