2020import pytest
2121
2222import bigframes .series
23- from tests .system .utils import assert_series_equal , skip_legacy_pandas
23+ from tests .system .utils import assert_series_equal
2424
2525DATETIME_COL_NAMES = [("datetime_col" ,), ("timestamp_col" ,)]
2626DATE_COLUMNS = [
3434 ("col_name" ,),
3535 DATE_COLUMNS ,
3636)
37- @skip_legacy_pandas
3837def test_dt_day (scalars_dfs , col_name ):
38+ # TODO: supply a reason why this isn't compatible with pandas 1.x
39+ pytest .importorskip ("pandas" , minversion = "2.0.0" )
3940 scalars_df , scalars_pandas_df = scalars_dfs
4041 bf_series : bigframes .series .Series = scalars_df [col_name ]
4142 bf_result = bf_series .dt .day .to_pandas ()
@@ -51,8 +52,9 @@ def test_dt_day(scalars_dfs, col_name):
5152 ("col_name" ,),
5253 DATETIME_COL_NAMES ,
5354)
54- @skip_legacy_pandas
5555def test_dt_date (scalars_dfs , col_name ):
56+ # TODO: supply a reason why this isn't compatible with pandas 1.x
57+ pytest .importorskip ("pandas" , minversion = "2.0.0" )
5658 scalars_df , scalars_pandas_df = scalars_dfs
5759 bf_series : bigframes .series .Series = scalars_df [col_name ]
5860 bf_result = bf_series .dt .date .to_pandas ()
@@ -68,8 +70,9 @@ def test_dt_date(scalars_dfs, col_name):
6870 ("col_name" ,),
6971 DATE_COLUMNS ,
7072)
71- @skip_legacy_pandas
7273def test_dt_dayofweek (scalars_dfs , col_name ):
74+ # TODO: supply a reason why this isn't compatible with pandas 1.x
75+ pytest .importorskip ("pandas" , minversion = "2.0.0" )
7376 scalars_df , scalars_pandas_df = scalars_dfs
7477 bf_series : bigframes .series .Series = scalars_df [col_name ]
7578 bf_result = bf_series .dt .dayofweek .to_pandas ()
@@ -82,8 +85,9 @@ def test_dt_dayofweek(scalars_dfs, col_name):
8285 ("col_name" ,),
8386 DATETIME_COL_NAMES ,
8487)
85- @skip_legacy_pandas
8688def test_dt_hour (scalars_dfs , col_name ):
89+ # TODO: supply a reason why this isn't compatible with pandas 1.x
90+ pytest .importorskip ("pandas" , minversion = "2.0.0" )
8791 scalars_df , scalars_pandas_df = scalars_dfs
8892 bf_series : bigframes .series .Series = scalars_df [col_name ]
8993 bf_result = bf_series .dt .hour .to_pandas ()
@@ -99,8 +103,9 @@ def test_dt_hour(scalars_dfs, col_name):
99103 ("col_name" ,),
100104 DATETIME_COL_NAMES ,
101105)
102- @skip_legacy_pandas
103106def test_dt_minute (scalars_dfs , col_name ):
107+ # TODO: supply a reason why this isn't compatible with pandas 1.x
108+ pytest .importorskip ("pandas" , minversion = "2.0.0" )
104109 scalars_df , scalars_pandas_df = scalars_dfs
105110 bf_series : bigframes .series .Series = scalars_df [col_name ]
106111 bf_result = bf_series .dt .minute .to_pandas ()
@@ -116,8 +121,9 @@ def test_dt_minute(scalars_dfs, col_name):
116121 ("col_name" ,),
117122 DATE_COLUMNS ,
118123)
119- @skip_legacy_pandas
120124def test_dt_month (scalars_dfs , col_name ):
125+ # TODO: supply a reason why this isn't compatible with pandas 1.x
126+ pytest .importorskip ("pandas" , minversion = "2.0.0" )
121127 scalars_df , scalars_pandas_df = scalars_dfs
122128 bf_series : bigframes .series .Series = scalars_df [col_name ]
123129 bf_result = bf_series .dt .month .to_pandas ()
@@ -133,8 +139,9 @@ def test_dt_month(scalars_dfs, col_name):
133139 ("col_name" ,),
134140 DATE_COLUMNS ,
135141)
136- @skip_legacy_pandas
137142def test_dt_quarter (scalars_dfs , col_name ):
143+ # TODO: supply a reason why this isn't compatible with pandas 1.x
144+ pytest .importorskip ("pandas" , minversion = "2.0.0" )
138145 scalars_df , scalars_pandas_df = scalars_dfs
139146 bf_series : bigframes .series .Series = scalars_df [col_name ]
140147 bf_result = bf_series .dt .quarter .to_pandas ()
@@ -150,8 +157,9 @@ def test_dt_quarter(scalars_dfs, col_name):
150157 ("col_name" ,),
151158 DATETIME_COL_NAMES ,
152159)
153- @skip_legacy_pandas
154160def test_dt_second (scalars_dfs , col_name ):
161+ # TODO: supply a reason why this isn't compatible with pandas 1.x
162+ pytest .importorskip ("pandas" , minversion = "2.0.0" )
155163 scalars_df , scalars_pandas_df = scalars_dfs
156164 bf_series : bigframes .series .Series = scalars_df [col_name ]
157165 bf_result = bf_series .dt .second .to_pandas ()
@@ -167,8 +175,9 @@ def test_dt_second(scalars_dfs, col_name):
167175 ("col_name" ,),
168176 DATETIME_COL_NAMES ,
169177)
170- @skip_legacy_pandas
171178def test_dt_time (scalars_dfs , col_name ):
179+ # TODO: supply a reason why this isn't compatible with pandas 1.x
180+ pytest .importorskip ("pandas" , minversion = "2.0.0" )
172181 scalars_df , scalars_pandas_df = scalars_dfs
173182 bf_series : bigframes .series .Series = scalars_df [col_name ]
174183 bf_result = bf_series .dt .time .to_pandas ()
@@ -184,8 +193,9 @@ def test_dt_time(scalars_dfs, col_name):
184193 ("col_name" ,),
185194 DATE_COLUMNS ,
186195)
187- @skip_legacy_pandas
188196def test_dt_year (scalars_dfs , col_name ):
197+ # TODO: supply a reason why this isn't compatible with pandas 1.x
198+ pytest .importorskip ("pandas" , minversion = "2.0.0" )
189199 scalars_df , scalars_pandas_df = scalars_dfs
190200 bf_series : bigframes .series .Series = scalars_df [col_name ]
191201 bf_result = bf_series .dt .year .to_pandas ()
@@ -201,8 +211,9 @@ def test_dt_year(scalars_dfs, col_name):
201211 ("col_name" ,),
202212 DATETIME_COL_NAMES ,
203213)
204- @skip_legacy_pandas
205214def test_dt_tz (scalars_dfs , col_name ):
215+ # TODO: supply a reason why this isn't compatible with pandas 1.x
216+ pytest .importorskip ("pandas" , minversion = "2.0.0" )
206217 scalars_df , scalars_pandas_df = scalars_dfs
207218 bf_series : bigframes .series .Series = scalars_df [col_name ]
208219 bf_result = bf_series .dt .tz
@@ -215,8 +226,9 @@ def test_dt_tz(scalars_dfs, col_name):
215226 ("col_name" ,),
216227 DATETIME_COL_NAMES ,
217228)
218- @skip_legacy_pandas
219229def test_dt_unit (scalars_dfs , col_name ):
230+ # TODO: supply a reason why this isn't compatible with pandas 1.x
231+ pytest .importorskip ("pandas" , minversion = "2.0.0" )
220232 scalars_df , scalars_pandas_df = scalars_dfs
221233 bf_series : bigframes .series .Series = scalars_df [col_name ]
222234 bf_result = bf_series .dt .unit
@@ -234,8 +246,9 @@ def test_dt_unit(scalars_dfs, col_name):
234246 ("datetime_col" , "%H:%M" ),
235247 ],
236248)
237- @skip_legacy_pandas
238249def test_dt_strftime (scalars_df_index , scalars_pandas_df_index , column , date_format ):
250+ # TODO: supply a reason why this isn't compatible with pandas 1.x
251+ pytest .importorskip ("pandas" , minversion = "2.0.0" )
239252 bf_result = scalars_df_index [column ].dt .strftime (date_format ).to_pandas ()
240253 pd_result = scalars_pandas_df_index [column ].dt .strftime (date_format )
241254 pd .testing .assert_series_equal (bf_result , pd_result , check_dtype = False )
@@ -276,8 +289,9 @@ def test_dt_strftime_time():
276289 ("col_name" ,),
277290 DATETIME_COL_NAMES ,
278291)
279- @skip_legacy_pandas
280292def test_dt_normalize (scalars_dfs , col_name ):
293+ # TODO: supply a reason why this isn't compatible with pandas 1.x
294+ pytest .importorskip ("pandas" , minversion = "2.0.0" )
281295 scalars_df , scalars_pandas_df = scalars_dfs
282296 bf_result = scalars_df [col_name ].dt .normalize ().to_pandas ()
283297 pd_result = scalars_pandas_df [col_name ].dt .normalize ()
@@ -297,8 +311,9 @@ def test_dt_normalize(scalars_dfs, col_name):
297311 ("datetime_col" , "us" ),
298312 ],
299313)
300- @skip_legacy_pandas
301314def test_dt_floor (scalars_dfs , col_name , freq ):
315+ # TODO: supply a reason why this isn't compatible with pandas 1.x
316+ pytest .importorskip ("pandas" , minversion = "2.0.0" )
302317 scalars_df , scalars_pandas_df = scalars_dfs
303318 bf_result = scalars_df [col_name ].dt .floor (freq ).to_pandas ()
304319 pd_result = scalars_pandas_df [col_name ].dt .floor (freq )
0 commit comments