Skip to content

API: EA._can_hold_na should be a dtype attribute, not EA #40574

Closed
@jbrockmendel

Description

@jbrockmendel

In practice in all the cases I'm aware of, _can_hold_na is always fixed at the EA subclass level, so we can immediately infer _can_hold_na from the dtype. But in principle ATM an EA subclass could do

class WeirdEA(ExtensionArray):
      @property
      def _can_hold_na(self) -> bool:
           return some_func(self[0])

We should make _can_hold_na an attribute of ExtensionDtype to pre-empt this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions