@@ -1247,7 +1247,9 @@ def test_coalesce(df):
1247
1247
pa .array ([4 , None , 6 ]), # integer column with null
1248
1248
pa .array (["hello " , None , " !" ]), # string column with null
1249
1249
pa .array (
1250
- [datetime (2022 , 12 , 31 , tzinfo = DEFAULT_TZ ), None , datetime (2020 , 7 , 2 , tzinfo = DEFAULT_TZ )]
1250
+ [datetime (2022 , 12 , 31 , tzinfo = DEFAULT_TZ ),
1251
+ None ,
1252
+ datetime (2020 , 7 , 2 , tzinfo = DEFAULT_TZ )]
1251
1253
), # datetime with null
1252
1254
pa .array ([False , None , True ]), # boolean column with null
1253
1255
],
@@ -1260,8 +1262,9 @@ def test_coalesce(df):
1260
1262
f .coalesce (column ("a" ), literal ("default" )).alias ("a_coalesced" ),
1261
1263
f .coalesce (column ("b" ), literal (0 )).alias ("b_coalesced" ),
1262
1264
f .coalesce (column ("c" ), literal ("default" )).alias ("c_coalesced" ),
1263
- f .coalesce (column ("d" ), literal (datetime (2000 , 1 , 1 , tzinfo = DEFAULT_TZ ))).alias ("d_coalesced" ),
1264
- f .coalesce (column ("e" ), literal (False )).alias ("e_coalesced" ),
1265
+ f .coalesce (column ("d" ), literal (datetime (2000 , 1 , 1 ,
1266
+ tzinfo = DEFAULT_TZ ))).alias ("d_coalesced" ),
1267
+ f .coalesce (column ("e" ), literal (value = False )).alias ("e_coalesced" ),
1265
1268
)
1266
1269
1267
1270
result = result_df .collect ()[0 ]
@@ -1275,8 +1278,8 @@ def test_coalesce(df):
1275
1278
["hello " , "default" , " !" ], type = pa .string_view ()
1276
1279
)
1277
1280
assert result .column (3 ).to_pylist () == [
1278
- datetime (2022 , 12 , 31 , tzinfo = DEFAULT_TZ ),
1279
- datetime (2000 , 1 , 1 , tzinfo = DEFAULT_TZ ),
1281
+ datetime (2022 , 12 , 31 , tzinfo = DEFAULT_TZ ),
1282
+ datetime (2000 , 1 , 1 , tzinfo = DEFAULT_TZ ),
1280
1283
datetime (2020 , 7 , 2 , tzinfo = DEFAULT_TZ )]
1281
1284
assert result .column (4 ) == pa .array ([False , False , True ], type = pa .bool_ ())
1282
1285
0 commit comments