Skip to content

BUG: self,_box_pa throws unique error when passed categorical or interval dtype #62682

@eicchen

Description

@eicchen

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd
import numpy as np

invalid1 = pd.Categorical(["test"])
invalid2 = pd.offsets.Minute(3)
arr = pd.array(["a", np.nan])
df1 = pd.DataFrame([[invalid1, invalid1]])
df2 = pd.DataFrame([[invalid2, invalid2]])

#Categories (1, str): ['test'] with type Categorical: did not recognize Python value type when inferring an Arrow data type
res1 = arr+df1
#pyarrow.lib.ArrowTypeError: No temporal attributes found on object.
res2 = arr+df2

Issue Description

Found issue while working on #61828, adding as separate issue for bookkeeping, will add after that PR gets merged as I am just reusing a test from it

Expected Behavior

raise clear error to user where/when error occurs

Installed Versions

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugNeeds TriageIssue that has not been reviewed by a pandas team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions