Skip to content

Validate dir for pd.errors and pd.util #57140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 31, 2024

Conversation

mroeschke
Copy link
Member

  • Validates dir(pd.errors) matches pd.errors.__all__ moved some items that were in the init to a new file since some of the items didn't seem to semantically belong there

  • Validate dir(pd.util) shows the public apis in the directory.

@mroeschke mroeschke added the API - Consistency Internal Consistency of API/Behavior label Jan 30, 2024
@mroeschke mroeschke added this to the 3.0 milestone Jan 30, 2024
@mroeschke mroeschke changed the title Validate dir for pd.errors and `pd.util Validate dir for pd.errors and pd.util Jan 30, 2024


.. warning::

The ``pandas.core``, ``pandas.compat``, and ``pandas.util`` top-level modules are PRIVATE. Stable functionality in such modules is not guaranteed.
The ``pandas.core``, ``pandas.compat`` top-level modules are PRIVATE. Stable functionality in such modules is not guaranteed.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've probably just missed this conversation along the way but what prevents us from prefixing these from an underscore to more clearly dictate that intent?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Especially for pandas.core, I think there's an unknown amount of use of internals and I think a conservative approach is desired (i.e. formally deprecate) to wean users off of it #27522. Most pertinent in my mind is objects that can be returned that are not exposed in the public API #55905

@mroeschke mroeschke merged commit cad0d87 into pandas-dev:main Jan 31, 2024
@mroeschke mroeschke deleted the api/stricter branch January 31, 2024 19:11
pmhatre1 pushed a commit to pmhatre1/pandas-pmhatre1 that referenced this pull request May 7, 2024
* Ensure pandas.errors only imports its __all__

* Make public util API accessible

* Fix import

* Type input
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API - Consistency Internal Consistency of API/Behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants