Skip to content

Commit 41698ed

Browse files
committed
feat(snowflake): implement ops.StructColumn
1 parent 45f4f05 commit 41698ed

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

ibis/backends/snowflake/registry.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ def _arbitrary(t, op):
260260
),
261261
ops.NthValue: _nth_value,
262262
ops.Arbitrary: _arbitrary,
263+
ops.StructColumn: lambda t, op: sa.func.object_construct_keep_null(
264+
*itertools.chain.from_iterable(zip(op.names, map(t.translate, op.values)))
265+
),
263266
}
264267
)
265268

ibis/backends/tests/test_struct.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def test_null_literal(con, field):
7575
tm.assert_series_equal(result, expected)
7676

7777

78-
@pytest.mark.notimpl(["dask", "pandas", "postgres", "snowflake"])
78+
@pytest.mark.notimpl(["dask", "pandas", "postgres"])
7979
def test_struct_column(alltypes, df):
8080
t = alltypes
8181
expr = ibis.struct(dict(a=t.string_col, b=1, c=t.bigint_col)).name("s")

0 commit comments

Comments
 (0)