Skip to content

Reading an Enum from csv raises a StringCache error #22764

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

Closed
2 tasks done
coastalwhite opened this issue May 15, 2025 · 0 comments · Fixed by #22765
Closed
2 tasks done

Reading an Enum from csv raises a StringCache error #22764

coastalwhite opened this issue May 15, 2025 · 0 comments · Fixed by #22765
Labels
bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars

Comments

@coastalwhite
Copy link
Collaborator

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

import polars as pl

with pl.StringCache():
    csv_data = pl.DataFrame({
        "someletter": ["A", "B"]
    })
    csv_data.write_csv("example.csv")
 
    schema = pl.Schema({
        "someletter": pl.Enum(["A", "B"]),
    })
    pl.scan_csv("example.csv", schema=schema).sink_parquet("example.parquet")

Log output

Issue description

StringCacheError.

Expected behavior

No error.

Installed versions

Replace this line with the output of pl.show_versions(). Leave the backticks in place.
@coastalwhite coastalwhite added bug Something isn't working python Related to Python Polars needs triage Awaiting prioritization by a maintainer labels May 15, 2025
coastalwhite added a commit to coastalwhite/polars that referenced this issue May 15, 2025
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