Skip to content

Commit

Permalink
feat(snowflake): implement typeof operation
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud authored and kszucs committed Jan 15, 2023
1 parent 3942d87 commit 029499c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ibis/backends/snowflake/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

import numpy as np
import sqlalchemy as sa
from snowflake.sqlalchemy.custom_types import VARIANT

import ibis.expr.operations as ops
from ibis.backends.base.sql.alchemy.registry import (
fixed_arity,
geospatial_functions,
reduction,
unary,
)
from ibis.backends.postgres.registry import _literal as _postgres_literal
from ibis.backends.postgres.registry import operation_registry as _operation_registry
Expand Down Expand Up @@ -161,6 +163,8 @@ def _extract_url_query(t, op):
),
1,
),
# snowflake typeof only accepts VARIANT
ops.TypeOf: unary(lambda arg: sa.func.typeof(sa.cast(arg, VARIANT))),
}
)

Expand All @@ -179,8 +183,6 @@ def _extract_url_query(t, op):
ops.ArrayRepeat,
ops.ArraySlice,
ops.Unnest,
# ibis.expr.operations.generic
ops.TypeOf,
# ibis.expr.operations.maps
ops.MapKeys,
# ibis.expr.operations.reductions
Expand Down

0 comments on commit 029499c

Please sign in to comment.