Skip to content

[FEA] Support Polars unary function negate. #17538

Closed
@taozuoqiao

Description

@taozuoqiao

Unary function negate is not supported yet,

import polars as pl

lf = pl.LazyFrame(
    {
        "a": [1, 2, 3, 4],
    }
)

with pl.Config() as cfg:
    cfg.set_verbose(True)
    print(lf.select(-pl.col('a')).collect(engine='gpu'))
    print(lf.select(+pl.col('a')).collect(engine='gpu'))

"""
/opt/miniconda3_py310/lib/python3.10/site-packages/polars/lazyframe/frame.py:2053: PerformanceWarning: Query execution with GPU not supported, reason: <class 'NotImplementedError'>: Unary function name='negate'
  return wrap_df(ldf.collect(callback))
shape: (4, 1)
┌─────┐
│ a   │
│ --- │
│ i64 │
╞═════╡
│ -1  │
│ -2  │
│ -3  │
│ -4  │
└─────┘
shape: (4, 1)
┌─────┐
│ a   │
│ --- │
│ i64 │
╞═════╡
│ 1   │
│ 2   │
│ 3   │
│ 4   │
└─────┘
"""

Metadata

Metadata

Assignees

Labels

cudf-polarsIssues specific to cudf-polarsfeature requestNew feature or request

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions