Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept Expr in pl.any() #11516

Open
stevenlis opened this issue Oct 4, 2023 · 1 comment · May be fixed by #17148
Open

Accept Expr in pl.any() #11516

stevenlis opened this issue Oct 4, 2023 · 1 comment · May be fixed by #17148
Labels
A-input-parsing Area: parsing input arguments accepted Ready for implementation enhancement New feature or an improvement of an existing feature

Comments

@stevenlis
Copy link

Description

It appears that the function pl.any() does not accept expressions like pl.any_horizontal.

import polars as pl
pl.DataFrame(
    {'a': ['1', '1', '2', '2'],
     'b': [False, True, False, False]}
).with_columns(
    pl.when(pl.any(pl.col('b')).over('a'))
    .then(1).otherwise(0)
)

The code above will return: ValueError: could not convert value 'Unknown' as a Literal and you have to use pl.any('b')

If this is intentional, maybe the error message should be "only expect string" (#11060)

#11497

@stevenlis stevenlis added the enhancement New feature or an improvement of an existing feature label Oct 4, 2023
@stinodego stinodego self-assigned this Oct 6, 2023
@stinodego stinodego added the accepted Ready for implementation label Oct 6, 2023
@stinodego
Copy link
Member

stinodego commented Oct 6, 2023

This WAS intentional but now that we have split out the horizontal functionality we can accept expressions here. I was planning to add it but didn't get to it yet.

@stinodego stinodego added the A-input-parsing Area: parsing input arguments label May 29, 2024
@stinodego stinodego removed their assignment May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-input-parsing Area: parsing input arguments accepted Ready for implementation enhancement New feature or an improvement of an existing feature
Projects
Status: Ready
Development

Successfully merging a pull request may close this issue.

2 participants