20
20
import pytest
21
21
22
22
import bigframes .series
23
- from tests .system .utils import assert_series_equal , skip_legacy_pandas
23
+ from tests .system .utils import assert_series_equal
24
24
25
25
DATETIME_COL_NAMES = [("datetime_col" ,), ("timestamp_col" ,)]
26
26
DATE_COLUMNS = [
34
34
("col_name" ,),
35
35
DATE_COLUMNS ,
36
36
)
37
- @skip_legacy_pandas
38
37
def 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" )
39
40
scalars_df , scalars_pandas_df = scalars_dfs
40
41
bf_series : bigframes .series .Series = scalars_df [col_name ]
41
42
bf_result = bf_series .dt .day .to_pandas ()
@@ -51,8 +52,9 @@ def test_dt_day(scalars_dfs, col_name):
51
52
("col_name" ,),
52
53
DATETIME_COL_NAMES ,
53
54
)
54
- @skip_legacy_pandas
55
55
def 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" )
56
58
scalars_df , scalars_pandas_df = scalars_dfs
57
59
bf_series : bigframes .series .Series = scalars_df [col_name ]
58
60
bf_result = bf_series .dt .date .to_pandas ()
@@ -68,8 +70,9 @@ def test_dt_date(scalars_dfs, col_name):
68
70
("col_name" ,),
69
71
DATE_COLUMNS ,
70
72
)
71
- @skip_legacy_pandas
72
73
def 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" )
73
76
scalars_df , scalars_pandas_df = scalars_dfs
74
77
bf_series : bigframes .series .Series = scalars_df [col_name ]
75
78
bf_result = bf_series .dt .dayofweek .to_pandas ()
@@ -82,8 +85,9 @@ def test_dt_dayofweek(scalars_dfs, col_name):
82
85
("col_name" ,),
83
86
DATETIME_COL_NAMES ,
84
87
)
85
- @skip_legacy_pandas
86
88
def 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" )
87
91
scalars_df , scalars_pandas_df = scalars_dfs
88
92
bf_series : bigframes .series .Series = scalars_df [col_name ]
89
93
bf_result = bf_series .dt .hour .to_pandas ()
@@ -99,8 +103,9 @@ def test_dt_hour(scalars_dfs, col_name):
99
103
("col_name" ,),
100
104
DATETIME_COL_NAMES ,
101
105
)
102
- @skip_legacy_pandas
103
106
def 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" )
104
109
scalars_df , scalars_pandas_df = scalars_dfs
105
110
bf_series : bigframes .series .Series = scalars_df [col_name ]
106
111
bf_result = bf_series .dt .minute .to_pandas ()
@@ -116,8 +121,9 @@ def test_dt_minute(scalars_dfs, col_name):
116
121
("col_name" ,),
117
122
DATE_COLUMNS ,
118
123
)
119
- @skip_legacy_pandas
120
124
def 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" )
121
127
scalars_df , scalars_pandas_df = scalars_dfs
122
128
bf_series : bigframes .series .Series = scalars_df [col_name ]
123
129
bf_result = bf_series .dt .month .to_pandas ()
@@ -133,8 +139,9 @@ def test_dt_month(scalars_dfs, col_name):
133
139
("col_name" ,),
134
140
DATE_COLUMNS ,
135
141
)
136
- @skip_legacy_pandas
137
142
def 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" )
138
145
scalars_df , scalars_pandas_df = scalars_dfs
139
146
bf_series : bigframes .series .Series = scalars_df [col_name ]
140
147
bf_result = bf_series .dt .quarter .to_pandas ()
@@ -150,8 +157,9 @@ def test_dt_quarter(scalars_dfs, col_name):
150
157
("col_name" ,),
151
158
DATETIME_COL_NAMES ,
152
159
)
153
- @skip_legacy_pandas
154
160
def 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" )
155
163
scalars_df , scalars_pandas_df = scalars_dfs
156
164
bf_series : bigframes .series .Series = scalars_df [col_name ]
157
165
bf_result = bf_series .dt .second .to_pandas ()
@@ -167,8 +175,9 @@ def test_dt_second(scalars_dfs, col_name):
167
175
("col_name" ,),
168
176
DATETIME_COL_NAMES ,
169
177
)
170
- @skip_legacy_pandas
171
178
def 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" )
172
181
scalars_df , scalars_pandas_df = scalars_dfs
173
182
bf_series : bigframes .series .Series = scalars_df [col_name ]
174
183
bf_result = bf_series .dt .time .to_pandas ()
@@ -184,8 +193,9 @@ def test_dt_time(scalars_dfs, col_name):
184
193
("col_name" ,),
185
194
DATE_COLUMNS ,
186
195
)
187
- @skip_legacy_pandas
188
196
def 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" )
189
199
scalars_df , scalars_pandas_df = scalars_dfs
190
200
bf_series : bigframes .series .Series = scalars_df [col_name ]
191
201
bf_result = bf_series .dt .year .to_pandas ()
@@ -201,8 +211,9 @@ def test_dt_year(scalars_dfs, col_name):
201
211
("col_name" ,),
202
212
DATETIME_COL_NAMES ,
203
213
)
204
- @skip_legacy_pandas
205
214
def 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" )
206
217
scalars_df , scalars_pandas_df = scalars_dfs
207
218
bf_series : bigframes .series .Series = scalars_df [col_name ]
208
219
bf_result = bf_series .dt .tz
@@ -215,8 +226,9 @@ def test_dt_tz(scalars_dfs, col_name):
215
226
("col_name" ,),
216
227
DATETIME_COL_NAMES ,
217
228
)
218
- @skip_legacy_pandas
219
229
def 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" )
220
232
scalars_df , scalars_pandas_df = scalars_dfs
221
233
bf_series : bigframes .series .Series = scalars_df [col_name ]
222
234
bf_result = bf_series .dt .unit
@@ -234,8 +246,9 @@ def test_dt_unit(scalars_dfs, col_name):
234
246
("datetime_col" , "%H:%M" ),
235
247
],
236
248
)
237
- @skip_legacy_pandas
238
249
def 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" )
239
252
bf_result = scalars_df_index [column ].dt .strftime (date_format ).to_pandas ()
240
253
pd_result = scalars_pandas_df_index [column ].dt .strftime (date_format )
241
254
pd .testing .assert_series_equal (bf_result , pd_result , check_dtype = False )
@@ -276,8 +289,9 @@ def test_dt_strftime_time():
276
289
("col_name" ,),
277
290
DATETIME_COL_NAMES ,
278
291
)
279
- @skip_legacy_pandas
280
292
def 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" )
281
295
scalars_df , scalars_pandas_df = scalars_dfs
282
296
bf_result = scalars_df [col_name ].dt .normalize ().to_pandas ()
283
297
pd_result = scalars_pandas_df [col_name ].dt .normalize ()
@@ -297,8 +311,9 @@ def test_dt_normalize(scalars_dfs, col_name):
297
311
("datetime_col" , "us" ),
298
312
],
299
313
)
300
- @skip_legacy_pandas
301
314
def 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" )
302
317
scalars_df , scalars_pandas_df = scalars_dfs
303
318
bf_result = scalars_df [col_name ].dt .floor (freq ).to_pandas ()
304
319
pd_result = scalars_pandas_df [col_name ].dt .floor (freq )
0 commit comments