Skip to content

DEPR: __finalize__ and _metadata #51280

Open
@jbrockmendel

Description

@jbrockmendel

We have some support for propagating metadata, but it is incomplete (38 xfails in tests/generic/test_finalize.py) for plain methods and has no real prospect for getting robust support for concat/merge etc.

At the same time, there is a real performance cost to calling __finalize__ everywhere, in an extreme case like #46505 these calls take up a quarter of the runtime.

AFAICT this is useful for a fraction of users and perf-hurting for everyone else. Do we have any idea how common it is to rely on these?

cc @MarcoGorelli

Metadata

Metadata

Assignees

No one assigned

    Labels

    DeprecateFunctionality to remove in pandasNeeds DiscussionRequires discussion from core team before further actionSubclassingSubclassing pandas objectsmetadata_metadata, .attrs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions