Skip to content

Commit

Permalink
feat(snowflake): implement ops.StructColumn
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Jan 22, 2023
1 parent 45f4f05 commit 41698ed
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ibis/backends/snowflake/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ def _arbitrary(t, op):
),
ops.NthValue: _nth_value,
ops.Arbitrary: _arbitrary,
ops.StructColumn: lambda t, op: sa.func.object_construct_keep_null(
*itertools.chain.from_iterable(zip(op.names, map(t.translate, op.values)))
),
}
)

Expand Down
2 changes: 1 addition & 1 deletion ibis/backends/tests/test_struct.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def test_null_literal(con, field):
tm.assert_series_equal(result, expected)


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

0 comments on commit 41698ed

Please sign in to comment.