Skip to content

Series.combine and ExtensionArrays #22850

Closed
@TomAugspurger

Description

Working on a PeriodArray. For the first thing I tried, Series.combine doesn't work.

In

pandas/pandas/core/series.py

Lines 2324 to 2330 in 7343fd3

elif is_extension_array_dtype(self.values):
# The function can return something of any type, so check
# if the type is compatible with the calling EA
try:
new_values = self._values._from_sequence(new_values)
except TypeError:
pass
we catch a TypeError. Why is that just a TypeError, when in principal the EA constructor could throw any kind of exception? In my case a ValueError is ValueError since the freq can't be inferred.

I think that should be except Exception instead. Thoughts @Dr-Irv?

Metadata

Assignees

No one assigned

    Labels

    Dtype ConversionsUnexpected or buggy dtype conversionsExtensionArrayExtending pandas with custom dtypes or arrays.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions