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

fix: Allow list.contains() for list of categoricals #14744

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

c-peters
Copy link
Collaborator

@c-peters c-peters commented Feb 28, 2024

fix #14559

Also a drive by fix for the List[categorical] <-> str where only the first value in the StringChunked was used:

df = pl.DataFrame(
    [(["a", "b"], "c"), (["a", "b"], "a")],
    schema={"li": pl.List(pl.Categorical), "x": pl.Categorical},
)
print(df.select(pl.col("li").list.contains(pl.col("x").cast(pl.Utf8))))
shape: (2, 1)
┌───────┐
│ li    │
│ ---   │
│ bool  │
╞═══════╡
│ false │
│ false │
└───────┘

@github-actions github-actions bot added fix Bug fix python Related to Python Polars rust Related to Rust Polars labels Feb 28, 2024
@ritchie46 ritchie46 merged commit 5cb48a3 into pola-rs:main Feb 29, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug fix python Related to Python Polars rust Related to Rust Polars
Projects
None yet
Development

Successfully merging this pull request may close these issues.

List(Categorical/Enum).contains(Categorical/Enum) is broken since 0.20.2
2 participants