Skip to content

[C++][Python] Support for pandas Categoricals with Intervals #30119

Closed as not planned

Description

@asfimport

Trying to write a pandas categorical created from pd.cut fails with the following error:

df_test = pd.DataFrame({"cat": pd.cut([1, 2, 3, 4, 5], bins=[2, 4])})
df_test.to_parquet("test.parquet")
File "pyarrow/error.pxi", line 120, in pyarrow.lib.check_status
pyarrow.lib.ArrowNotImplementedError: Unsupported cast from dictionary<values=extension<pandas.interval<ArrowIntervalType>>, indices=int8, ordered=1> to extension<pandas.interval<ArrowIntervalType>> (no available cast function for target type)

The problems seems to be the interval dtype. Specifing the labels keyword solved the problem.

Reporter: Alberto Torres

Related issues:

Note: This issue was originally created as ARROW-14569. Please see the migration documentation for further details.

Activity

  1. asfimport commented on Nov 3, 2021

    @asfimport
    Author

    David Li / @lidavidm:
    Looks like we need a cast from dictionary to extension (at least just looking at the error).

  2. github-actions commented on Feb 23, 2026

    @github-actions

    This issue has been marked as stale because it has had no activity in the past 365 days. Please remove the stale label or comment below, or this issue will be closed in 14 days. If this improvement is still desired but has no current owner, please add the 'Status: needs champion' label.

  3. added
    Status: stale-warning
    on Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Component: C++Component: PythonStatus: stale-warningType: enhancementgood-second-issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions