Skip to content

Commit

Permalink
chore(deps): lock file maintenance (#10134)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Phillip Cloud <417981+cpcloud@users.noreply.github.com>
  • Loading branch information
renovate[bot] and cpcloud authored Sep 17, 2024
1 parent 8681e50 commit e50642d
Show file tree
Hide file tree
Showing 3 changed files with 611 additions and 563 deletions.
19 changes: 12 additions & 7 deletions ibis/backends/polars/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1290,16 +1290,18 @@ def execute_count_distinct_star(op, **kw):
# Convert polars series into a list
# -> map the function element by element
# -> convert back to a polars series
InputType.PYTHON: lambda func, dtype, args: pl.Series(
map(func, *(arg.to_list() for arg in args)),
InputType.PYTHON: lambda func, dtype, fields, args: pl.Series(
map(func, *(arg.to_list() for arg in map(args.struct.field, fields))),
dtype=PolarsType.from_ibis(dtype),
),
# Convert polars series into a pyarrow array
# -> invoke the function on the pyarrow array
# -> cast the result to match the ibis dtype
# -> convert back to a polars series
InputType.PYARROW: lambda func, dtype, args: pl.from_arrow(
func(*(arg.to_arrow() for arg in args)).cast(dtype.to_pyarrow()),
InputType.PYARROW: lambda func, dtype, fields, args: pl.from_arrow(
func(*(arg.to_arrow() for arg in map(args.struct.field, fields))).cast(
dtype.to_pyarrow()
),
),
}

Expand All @@ -1309,9 +1311,12 @@ def execute_scalar_udf(op, **kw):
input_type = op.__input_type__
if input_type in _UDF_INVOKERS:
dtype = op.dtype
return pl.map_batches(
exprs=[translate(arg, **kw) for arg in op.args],
function=partial(_UDF_INVOKERS[input_type], op.__func__, dtype),
argnames = op.argnames
args = pl.struct(
**dict(zip(argnames, (translate(arg, **kw) for arg in op.args)))
)
return args.map_batches(
function=partial(_UDF_INVOKERS[input_type], op.__func__, dtype, argnames),
return_dtype=PolarsType.from_ibis(dtype),
)
elif input_type == InputType.BUILTIN:
Expand Down
Loading

0 comments on commit e50642d

Please sign in to comment.