Skip to content

DOC: ExtensionDtype.empty is not in the API reference #71766

Open

Description

@mmporong

Pandas version checks

  • I have checked that the issue still exists on the latest versions of the docs on main here

Location of the documentation

https://pandas.pydata.org/docs/dev/reference/api/pandas.api.extensions.ExtensionDtype.html (source: doc/source/reference/extensions.rst)
https://pandas.pydata.org/docs/dev/development/extending.html

Documentation problem

Facts collected by an AI agent (quoted verbatim):

ExtensionDtype.empty(self, shape) in pandas/core/dtypes/base.py has no leading underscore and has a docstring ("Construct an ExtensionArray of this dtype with the given shape. Analogous to numpy.empty."). It was added in #45024. The API reference lists construct_array_type, construct_from_string, is_dtype, kind, name, names, na_value and type for ExtensionDtype, but not empty, and the extending guide does not mention it. pandas-stubs only covers the public API, so pandas-dev/pandas-stubs#2034, which fixes the stub of this method, is waiting for this.

import pandas as pd  # 3.1.0
print(type(pd.Int64Dtype().empty(3)).__name__)        # IntegerArray
print(type(pd.StringDtype().empty(2)).__name__)       # StringArray
print(type(pd.CategoricalDtype().empty(2)).__name__)  # Categorical

Suggested fix for documentation

If this method is part of the public API, please add it to the documentation. If it is internal, please let us know.

AI disclosure: I used Claude Code (Claude Opus 5.5, effort: xhigh) to collect the facts quoted above and to run the snippet; the quoted text and the code block are its output. I wrote this request in Korean and the same tool translated it into English

Activity

  1. added
    Needs TriageIssue that has not been reviewed by a pandas team member
    on Oct 29, 2026
  2. Lahari25 commented on Oct 29, 2026

    @Lahari25

    /take

  3. github-actions commented on Oct 29, 2026

    @github-actions
    Contributor

    Thanks for your interest, @Lahari25! This issue is still labeled Needs Triage, which means it needs another look before work starts — so it isn't open to claim just yet. Please hold off on a PR until that label is removed. See the contributing guide for more.

  4. MonikaDvorackova commented on Oct 30, 2026

    @MonikaDvorackova

    /take

  5. github-actions commented on Oct 30, 2026

    @github-actions
    Contributor

    Thanks for your interest, @MonikaDvorackova! This issue is still labeled Needs Triage, which means it needs another look before work starts — so it isn't open to claim just yet. Please hold off on a PR until that label is removed. See the contributing guide for more.

  6. removed
    Needs TriageIssue that has not been reviewed by a pandas team member
    on Nov 4, 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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions