Skip to content

Commit 9e80231

Browse files
cpcloudkszucs
authored andcommitted
refactor(snowflake): remove unnecessary parse_json call in ops.StructField impl
1 parent 70f24a7 commit 9e80231

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ibis/backends/snowflake/registry.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ def _nth_value(t, op):
231231
ops.DateFromYMD: fixed_arity(sa.func.date_from_parts, 3),
232232
ops.StringToTimestamp: fixed_arity(sa.func.to_timestamp_tz, 2),
233233
ops.RegexExtract: fixed_arity(sa.func.regexp_substr, 3),
234-
ops.RegexSearch: fixed_arity(lambda left, right: left.op('REGEXP')(right), 2),
234+
ops.RegexSearch: fixed_arity(sa.sql.operators.custom_op("REGEXP"), 2),
235235
ops.RegexReplace: fixed_arity(sa.func.regexp_replace, 3),
236236
ops.ExtractMillisecond: fixed_arity(
237237
lambda arg: sa.cast(
@@ -244,8 +244,7 @@ def _nth_value(t, op):
244244
t.translate(op.arg), _TIMESTAMP_UNITS_TO_SCALE[op.unit]
245245
),
246246
ops.StructField: lambda t, op: sa.cast(
247-
sa.func.parse_json(sa.func.get(t.translate(op.arg), op.field)),
248-
t.get_sqla_type(op.output_dtype),
247+
sa.func.get(t.translate(op.arg), op.field), t.get_sqla_type(op.output_dtype)
249248
),
250249
ops.NthValue: _nth_value,
251250
}

0 commit comments

Comments
 (0)