File tree 2 files changed +8
-4
lines changed
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -609,6 +609,11 @@ def compile(translator, expr):
609
609
return compile
610
610
611
611
612
+ def _array_column (t , expr ):
613
+ args = ", " .join (map (t .translate , expr .op ().cols ))
614
+ return f"[{ args } ]"
615
+
616
+
612
617
# TODO: clickhouse uses different string functions
613
618
# for ascii and utf-8 encodings,
614
619
@@ -762,6 +767,7 @@ def compile(translator, expr):
762
767
ops .Degrees : _unary ("degrees" ),
763
768
ops .Radians : _unary ("radians" ),
764
769
ops .Strftime : _fixed_arity ("formatDateTime" , 2 ),
770
+ ops .ArrayColumn : _array_column ,
765
771
}
766
772
767
773
Original file line number Diff line number Diff line change 10
10
pytestmark = pytest .mark .never (["sqlite" , "mysql" ], reason = "No array support" )
11
11
12
12
13
- @pytest .mark .notimpl (["impala" , "clickhouse" , " datafusion" ])
13
+ @pytest .mark .notimpl (["impala" , "datafusion" ])
14
14
def test_array_column (backend , alltypes , df ):
15
15
expr = ibis .array ([alltypes ['double_col' ], alltypes ['double_col' ]])
16
16
assert isinstance (expr , ir .ArrayColumn )
17
17
18
18
result = expr .execute ()
19
19
expected = df .apply (
20
- lambda row : np .array (
21
- [row ['double_col' ], row ['double_col' ]], dtype = object
22
- ),
20
+ lambda row : [row ['double_col' ], row ['double_col' ]],
23
21
axis = 1 ,
24
22
)
25
23
backend .assert_series_equal (result , expected , check_names = False )
You can’t perform that action at this time.
0 commit comments