@@ -382,20 +382,28 @@ def test_condition_equal_columns_two_arrays_different_shapes() -> None:
382382 assert actual .to_list () == [False ]
383383
384384
385- def test_condition_equal_columns_empty_arrays () -> None :
385+ @pytest .mark .parametrize (
386+ "lhs_type" , [pl .Array (pl .Float64 , shape = 0 ), pl .List (pl .Float64 )]
387+ )
388+ @pytest .mark .parametrize (
389+ "rhs_type" , [pl .Array (pl .Float64 , shape = 0 ), pl .List (pl .Float64 )]
390+ )
391+ def test_condition_equal_columns_empty_list_array (
392+ lhs_type : pl .DataType , rhs_type : pl .DataType
393+ ) -> None :
386394 lhs = pl .DataFrame (
387395 {
388396 "pk" : [1 , 2 ],
389397 "a_left" : [[], None ],
390398 },
391- schema = {"pk" : pl .Int64 , "a_left" : pl . Array ( pl . Float64 , shape = 0 ) },
399+ schema = {"pk" : pl .Int64 , "a_left" : lhs_type },
392400 )
393401 rhs = pl .DataFrame (
394402 {
395403 "pk" : [1 , 2 ],
396404 "a_right" : [[], None ],
397405 },
398- schema = {"pk" : pl .Int64 , "a_right" : pl . Array ( pl . Float64 , shape = 0 ) },
406+ schema = {"pk" : pl .Int64 , "a_right" : rhs_type },
399407 )
400408
401409 actual = (
@@ -413,37 +421,6 @@ def test_condition_equal_columns_empty_arrays() -> None:
413421 assert actual .to_list () == [True , True ]
414422
415423
416- def test_condition_equal_columns_empty_lists () -> None :
417- lhs = pl .DataFrame (
418- {
419- "pk" : [1 , 2 , 3 ],
420- "a_left" : [[], None , []],
421- },
422- schema = {"pk" : pl .Int64 , "a_left" : pl .List (pl .Float64 )},
423- )
424- rhs = pl .DataFrame (
425- {
426- "pk" : [1 , 2 , 3 ],
427- "a_right" : [[], None , None ],
428- },
429- schema = {"pk" : pl .Int64 , "a_right" : pl .List (pl .Float64 )},
430- )
431-
432- actual = (
433- lhs .join (rhs , on = "pk" , maintain_order = "left" )
434- .select (
435- condition_equal_columns (
436- "a" ,
437- dtype_left = lhs .schema ["a_left" ],
438- dtype_right = rhs .schema ["a_right" ],
439- max_list_length = 0 ,
440- )
441- )
442- .to_series ()
443- )
444- assert actual .to_list () == [True , True , False ]
445-
446-
447424@pytest .mark .parametrize (
448425 ("dtype_left" , "dtype_right" , "can_compare_dtypes" ),
449426 [
0 commit comments