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

Unexpected behavior in clip #8090

Closed
2 tasks done
marsupialtail opened this issue Apr 9, 2023 · 3 comments
Closed
2 tasks done

Unexpected behavior in clip #8090

marsupialtail opened this issue Apr 9, 2023 · 3 comments
Assignees
Labels
bug Something isn't working P-medium Priority: medium python Related to Python Polars

Comments

@marsupialtail
Copy link

Polars version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of Polars.

Issue description

Clip doesn't seem to work across data types.

Reproducible example

a = polars.from_dict({"a":[1,1,2,2], "b":['{"my_field": "quack"}','{"my_field": "quack"}','{"my_field": "quack"}','{"my_field": "quack"}']})
a.with_columns([polars.col("a").clip(1.5, 1.6)])

This will return 1,1,1,1 for the a column.

Expected behavior

The a column should maybe be 1.5, 1.5, 1.6, 1.6?

Installed versions

0.16.15
@marsupialtail marsupialtail added bug Something isn't working python Related to Python Polars labels Apr 9, 2023
@ritchie46
Copy link
Member

Yeah.. should the argument type cast the whole column? What if the column is a float and users pass integers as clip args? I am not sure about this one.

@marsupialtail
Copy link
Author

I think maybe you can raise an error or warning and say the types are incongruent when this happens

@stinodego stinodego added the needs triage Awaiting prioritization by a maintainer label Jan 13, 2024
@stinodego stinodego self-assigned this Jan 14, 2024
@stinodego stinodego added P-medium Priority: medium and removed needs triage Awaiting prioritization by a maintainer labels Jan 14, 2024
@stinodego
Copy link
Member

Closing in favor of #11385

@stinodego stinodego closed this as not planned Won't fix, can't repro, duplicate, stale Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P-medium Priority: medium python Related to Python Polars
Projects
Archived in project
Development

No branches or pull requests

3 participants