@@ -59,6 +59,7 @@ def test_engines_astype_int(scalars_array_value: array_value.ArrayValue, engine)
5959 ops .AsTypeOp (to_type = bigframes .dtypes .INT_DTYPE ),
6060 excluded_cols = ["string_col" ],
6161 )
62+
6263 assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
6364
6465
@@ -73,6 +74,7 @@ def test_engines_astype_string_int(scalars_array_value: array_value.ArrayValue,
7374 for val in vals
7475 ]
7576 )
77+
7678 assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
7779
7880
@@ -83,6 +85,7 @@ def test_engines_astype_float(scalars_array_value: array_value.ArrayValue, engin
8385 ops .AsTypeOp (to_type = bigframes .dtypes .FLOAT_DTYPE ),
8486 excluded_cols = ["string_col" ],
8587 )
88+
8689 assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
8790
8891
@@ -99,6 +102,7 @@ def test_engines_astype_string_float(
99102 for val in vals
100103 ]
101104 )
105+
102106 assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
103107
104108
@@ -107,6 +111,7 @@ def test_engines_astype_bool(scalars_array_value: array_value.ArrayValue, engine
107111 arr = apply_op (
108112 scalars_array_value , ops .AsTypeOp (to_type = bigframes .dtypes .BOOL_DTYPE )
109113 )
114+
110115 assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
111116
112117
@@ -118,6 +123,7 @@ def test_engines_astype_string(scalars_array_value: array_value.ArrayValue, engi
118123 ops .AsTypeOp (to_type = bigframes .dtypes .STRING_DTYPE ),
119124 excluded_cols = ["float64_col" ],
120125 )
126+
121127 assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
122128
123129
@@ -128,6 +134,7 @@ def test_engines_astype_numeric(scalars_array_value: array_value.ArrayValue, eng
128134 ops .AsTypeOp (to_type = bigframes .dtypes .NUMERIC_DTYPE ),
129135 excluded_cols = ["string_col" ],
130136 )
137+
131138 assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
132139
133140
@@ -144,6 +151,7 @@ def test_engines_astype_string_numeric(
144151 for val in vals
145152 ]
146153 )
154+
147155 assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
148156
149157
@@ -154,6 +162,7 @@ def test_engines_astype_date(scalars_array_value: array_value.ArrayValue, engine
154162 ops .AsTypeOp (to_type = bigframes .dtypes .DATE_DTYPE ),
155163 excluded_cols = ["string_col" ],
156164 )
165+
157166 assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
158167
159168
@@ -170,6 +179,7 @@ def test_engines_astype_string_date(
170179 for val in vals
171180 ]
172181 )
182+
173183 assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
174184
175185
@@ -180,6 +190,7 @@ def test_engines_astype_datetime(scalars_array_value: array_value.ArrayValue, en
180190 ops .AsTypeOp (to_type = bigframes .dtypes .DATETIME_DTYPE ),
181191 excluded_cols = ["string_col" ],
182192 )
193+
183194 assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
184195
185196
@@ -196,6 +207,7 @@ def test_engines_astype_string_datetime(
196207 for val in vals
197208 ]
198209 )
210+
199211 assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
200212
201213
@@ -206,6 +218,7 @@ def test_engines_astype_timestamp(scalars_array_value: array_value.ArrayValue, e
206218 ops .AsTypeOp (to_type = bigframes .dtypes .TIMESTAMP_DTYPE ),
207219 excluded_cols = ["string_col" ],
208220 )
221+
209222 assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
210223
211224
@@ -226,6 +239,7 @@ def test_engines_astype_string_timestamp(
226239 for val in vals
227240 ]
228241 )
242+
229243 assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
230244
231245
@@ -236,6 +250,7 @@ def test_engines_astype_time(scalars_array_value: array_value.ArrayValue, engine
236250 ops .AsTypeOp (to_type = bigframes .dtypes .TIME_DTYPE ),
237251 excluded_cols = ["string_col" , "int64_col" , "int64_too" ],
238252 )
253+
239254 assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
240255
241256
@@ -256,6 +271,7 @@ def test_engines_astype_from_json(scalars_array_value: array_value.ArrayValue, e
256271 ),
257272 ]
258273 arr , _ = scalars_array_value .compute_values (exprs )
274+
259275 assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
260276
261277
@@ -265,4 +281,112 @@ def test_engines_astype_timedelta(scalars_array_value: array_value.ArrayValue, e
265281 scalars_array_value ,
266282 ops .AsTypeOp (to_type = bigframes .dtypes .TIMEDELTA_DTYPE ),
267283 )
284+
285+ assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
286+
287+
288+ @pytest .mark .parametrize ("engine" , ["polars" , "bq" ], indirect = True )
289+ def test_engines_where_op (scalars_array_value : array_value .ArrayValue , engine ):
290+ arr , _ = scalars_array_value .compute_values (
291+ [
292+ ops .where_op .as_expr (
293+ expression .deref ("int64_col" ),
294+ expression .deref ("bool_col" ),
295+ expression .deref ("float64_col" ),
296+ )
297+ ]
298+ )
299+
300+ assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
301+
302+
303+ @pytest .mark .parametrize ("engine" , ["polars" , "bq" ], indirect = True )
304+ def test_engines_coalesce_op (scalars_array_value : array_value .ArrayValue , engine ):
305+ arr , _ = scalars_array_value .compute_values (
306+ [
307+ ops .coalesce_op .as_expr (
308+ expression .deref ("int64_col" ),
309+ expression .deref ("float64_col" ),
310+ )
311+ ]
312+ )
313+
314+ assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
315+
316+
317+ @pytest .mark .parametrize ("engine" , ["polars" , "bq" ], indirect = True )
318+ def test_engines_fillna_op (scalars_array_value : array_value .ArrayValue , engine ):
319+ arr , _ = scalars_array_value .compute_values (
320+ [
321+ ops .fillna_op .as_expr (
322+ expression .deref ("int64_col" ),
323+ expression .deref ("float64_col" ),
324+ )
325+ ]
326+ )
327+
328+ assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
329+
330+
331+ @pytest .mark .parametrize ("engine" , ["polars" , "bq" ], indirect = True )
332+ def test_engines_casewhen_op_single_case (
333+ scalars_array_value : array_value .ArrayValue , engine
334+ ):
335+ arr , _ = scalars_array_value .compute_values (
336+ [
337+ ops .case_when_op .as_expr (
338+ expression .deref ("bool_col" ),
339+ expression .deref ("int64_col" ),
340+ )
341+ ]
342+ )
343+
344+ assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
345+
346+
347+ @pytest .mark .parametrize ("engine" , ["polars" , "bq" ], indirect = True )
348+ def test_engines_casewhen_op_double_case (
349+ scalars_array_value : array_value .ArrayValue , engine
350+ ):
351+ arr , _ = scalars_array_value .compute_values (
352+ [
353+ ops .case_when_op .as_expr (
354+ ops .gt_op .as_expr (expression .deref ("int64_col" ), expression .const (3 )),
355+ expression .deref ("int64_col" ),
356+ ops .lt_op .as_expr (expression .deref ("int64_col" ), expression .const (- 3 )),
357+ expression .deref ("int64_too" ),
358+ )
359+ ]
360+ )
361+
362+ assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
363+
364+
365+ @pytest .mark .parametrize ("engine" , ["polars" , "bq" ], indirect = True )
366+ def test_engines_isnull_op (scalars_array_value : array_value .ArrayValue , engine ):
367+ arr , _ = scalars_array_value .compute_values (
368+ [ops .isnull_op .as_expr (expression .deref ("string_col" ))]
369+ )
370+
371+ assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
372+
373+
374+ @pytest .mark .parametrize ("engine" , ["polars" , "bq" ], indirect = True )
375+ def test_engines_notnull_op (scalars_array_value : array_value .ArrayValue , engine ):
376+ arr , _ = scalars_array_value .compute_values (
377+ [ops .notnull_op .as_expr (expression .deref ("string_col" ))]
378+ )
379+
380+ assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
381+
382+
383+ @pytest .mark .parametrize ("engine" , ["polars" , "bq" ], indirect = True )
384+ def test_engines_invert_op (scalars_array_value : array_value .ArrayValue , engine ):
385+ arr , _ = scalars_array_value .compute_values (
386+ [
387+ ops .invert_op .as_expr (expression .deref ("bytes_col" )),
388+ ops .invert_op .as_expr (expression .deref ("bool_col" )),
389+ ]
390+ )
391+
268392 assert_equivalence_execution (arr .node , REFERENCE_ENGINE , engine )
0 commit comments