Skip to content

[Python] Honor the strings_to_categorical keyword in to_pandas for string view type #45175

Closed

Description

@jorisvandenbossche

Currently this keyword works for string or large string:

>>> table = pa.table({"col": pa.array(["a", "b", "a"], pa.string())})
>>> table.to_pandas(strings_to_categorical=True).dtypes
col    category
dtype: object
>>> table = pa.table({"col": pa.array(["a", "b", "a"], pa.large_string())})
>>> table.to_pandas(strings_to_categorical=True).dtypes
col    category
dtype: object

but not for string view:

>>> table = pa.table({"col": pa.array(["a", "b", "a"], pa.string_view())})
>>> table.to_pandas(strings_to_categorical=True).dtypes
col    object
dtype: object

For consistency we should make that keyword check for string view columns as well, I think

From https://github.com/apache/arrow/pull/44195/files#r1901831460

Activity

  1. added a commit that references this issue on Jan 7, 2025
  2. raulcd commented on Jan 7, 2025

    @raulcd
    Member

    Issue resolved by pull request 45176
    #45176

  3. added this to the 19.0.0 milestone on Jan 7, 2025
  4. raulcd commented on Jan 7, 2025

    @raulcd
    Member

    I've read the linked issue and it seems we wanted this for 19.0.0. @amoeba I've marked it as 19.0.0

  5. added 2 commits that reference this issue on Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions