Skip to content

Public pandas API and pandas-stubs #161

Open
@twoertwein

Description

@twoertwein

The public API is defined based on this page https://pandas.pydata.org/docs/reference/index.html Since there are many classes/functions that should be public but are not listed there it becomes a bit ambiguous what is public and what is not. People often seem to assume that classes/functions that do not start with _ are by common conventions public (see for example fphammerle/freesurfer-stats#15, as far as I know nothing in io/common is public).

Ideally, the docs are updated to make it less of a guessing game which parts are public and which are not. Personally, I think it would be great if pandas uses the criteria of a py.typed library to determine what is public (use _, __all__, and redundant imports): that should make it unambiguous what is public and what is not, even if a user never looks at the docs. The best time to add deprecations would be before the 1.5 releases!

In the meantime, it would be great to have a discussion of what should be in the stubs and what shouldn't be in here to avoid more confusion/ambiguity (don't want to "endorse" something as public that is not meant to be public). One rather strict approach could be to add only new classes/functions that are reported through "reasonable" issues: annotate what is being used. (edit: another option is to only add annotations for what is referenced in the various api.pys)

cc @Dr-Irv @bashtage @jreback @simonjayhawkins

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions