@@ -1247,7 +1247,7 @@ 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 ), None , datetime (2020 , 7 , 2 )]
1250
+ [datetime (2022 , 12 , 31 , tzinfo = DEFAULT_TZ ), None , datetime (2020 , 7 , 2 , tzinfo = DEFAULT_TZ )]
1251
1251
), # datetime with null
1252
1252
pa .array ([False , None , True ]), # boolean column with null
1253
1253
],
@@ -1260,7 +1260,7 @@ def test_coalesce(df):
1260
1260
f .coalesce (column ("a" ), literal ("default" )).alias ("a_coalesced" ),
1261
1261
f .coalesce (column ("b" ), literal (0 )).alias ("b_coalesced" ),
1262
1262
f .coalesce (column ("c" ), literal ("default" )).alias ("c_coalesced" ),
1263
- f .coalesce (column ("d" ), literal (datetime (2000 , 1 , 1 ))).alias ("d_coalesced" ),
1263
+ f .coalesce (column ("d" ), literal (datetime (2000 , 1 , 1 , tzinfo = DEFAULT_TZ ))).alias ("d_coalesced" ),
1264
1264
f .coalesce (column ("e" ), literal (False )).alias ("e_coalesced" ),
1265
1265
)
1266
1266
@@ -1274,10 +1274,10 @@ def test_coalesce(df):
1274
1274
assert result .column (2 ) == pa .array (
1275
1275
["hello " , "default" , " !" ], type = pa .string_view ()
1276
1276
)
1277
- assert result .column (3 ) == pa . array (
1278
- [ datetime (2022 , 12 , 31 ), datetime ( 2000 , 1 , 1 ), datetime ( 2020 , 7 , 2 )],
1279
- type = pa . timestamp ( "us" ),
1280
- )
1277
+ assert result .column (3 ). to_pylist () == [
1278
+ datetime (2022 , 12 , 31 , tzinfo = DEFAULT_TZ ),
1279
+ datetime ( 2000 , 1 , 1 , tzinfo = DEFAULT_TZ ),
1280
+ datetime ( 2020 , 7 , 2 , tzinfo = DEFAULT_TZ )]
1281
1281
assert result .column (4 ) == pa .array ([False , False , True ], type = pa .bool_ ())
1282
1282
1283
1283
# Test multiple arguments
0 commit comments