Skip to content

Commit

Permalink
chore(snowflake): move all array rules to the same place
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Nov 19, 2023
1 parent bedc795 commit 186b61e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ibis/backends/snowflake/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ def _timestamp_bucket(t, op):
{
ops.JSONGetItem: fixed_arity(sa.func.get, 2),
ops.StringFind: _string_find,
ops.ArrayZip: _array_zip,
ops.Map: fixed_arity(
lambda keys, values: sa.func.iff(
sa.func.is_array(keys) & sa.func.is_array(values),
Expand Down Expand Up @@ -420,6 +419,9 @@ def _timestamp_bucket(t, op):
),
ops.ArrayRemove: fixed_arity(sa.func.array_remove, 2),
ops.ArrayIntersect: fixed_arity(sa.func.array_intersection, 2),
ops.ArrayZip: _array_zip,
ops.ArraySort: unary(sa.func.ibis_udfs.public.array_sort),
ops.ArrayRepeat: fixed_arity(sa.func.ibis_udfs.public.array_repeat, 2),
ops.StringSplit: fixed_arity(sa.func.split, 2),
# snowflake typeof only accepts VARIANT, so we cast
ops.TypeOf: unary(lambda arg: sa.func.typeof(sa.func.to_variant(arg))),
Expand Down Expand Up @@ -478,8 +480,6 @@ def _timestamp_bucket(t, op):
ops.Median: reduction(sa.func.median),
ops.TableColumn: _table_column,
ops.Levenshtein: fixed_arity(sa.func.editdistance, 2),
ops.ArraySort: unary(sa.func.ibis_udfs.public.array_sort),
ops.ArrayRepeat: fixed_arity(sa.func.ibis_udfs.public.array_repeat, 2),
ops.TimeDelta: fixed_arity(
lambda part, left, right: sa.func.timediff(part, right, left), 3
),
Expand Down

0 comments on commit 186b61e

Please sign in to comment.