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

is_in errors for String series in Categorical/Enum series #14575

Closed
2 tasks done
mcrumiller opened this issue Feb 18, 2024 · 0 comments · Fixed by #14576
Closed
2 tasks done

is_in errors for String series in Categorical/Enum series #14575

mcrumiller opened this issue Feb 18, 2024 · 0 comments · Fixed by #14576
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars

Comments

@mcrumiller
Copy link
Contributor

mcrumiller commented Feb 18, 2024

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

>>> pl.Series(["a", "b"]).is_in(pl.Series(["a", "c"], dtype=pl.Categorical))
>>> pl.Series(["a", "b"]).is_in(pl.Series(["a", "c"], dtype=pl.Enum(["a", "c"])))

Log output

polars.exceptions.InvalidOperationError: `is_in` cannot check for Enum(Some(local), Physical) values in String data

Issue description

s1.is_in(s2) errors if s1 is string and s2 is cat/enum. String and cat/enum comparisons should be valid.

Expected behavior

Should work.

Installed versions

--------Version info---------
Polars:               0.20.9
Index type:           UInt32
Platform:             Linux-5.15.133.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
Python:               3.12.1 (main, Jan 31 2024, 09:51:46) [GCC 11.4.0]

----Optional dependencies----
adbc_driver_manager:  0.9.0
cloudpickle:          3.0.0
connectorx:           <not installed>
deltalake:            0.15.3
fsspec:               2023.12.2
gevent:               24.2.1
hvplot:               0.9.2
matplotlib:           3.8.2
numpy:                1.26.4
openpyxl:             3.1.2
pandas:               2.2.0
pyarrow:              15.0.0
pydantic:             2.6.1
pyiceberg:            0.5.1
pyxlsb:               1.0.10
sqlalchemy:           2.0.27
xlsx2csv:             0.8.1
xlsxwriter:           3.1.9
@mcrumiller mcrumiller added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Feb 18, 2024
@mcrumiller mcrumiller changed the title Cannot check if String series is in Categorical/Enum series is_in errors for when seeing if String series is in Categorical/Enum series Feb 18, 2024
@mcrumiller mcrumiller changed the title is_in errors for when seeing if String series is in Categorical/Enum series is_in errors for String series in Categorical/Enum series Feb 18, 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 needs triage Awaiting prioritization by a maintainer python Related to Python Polars
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant