-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
adding pandas.api.typing.aliases and docs #61735
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are to make these public, what is the process of making changes to them?
doc/source/reference/aliases.rst
Outdated
.. currentmodule:: pandas.api.atyping.aliases | ||
|
||
The typing declarations in ``pandas/_typing.py`` are considered private, and used | ||
by pandasdevelopers for type checking of the pandascode base. For users, it is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
by pandasdevelopers for type checking of the pandascode base. For users, it is | |
by pandas developers for type checking of the pandas code base. For users, it is |
This also occurs more times below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed in next commit
doc/source/whatsnew/v3.0.0.rst
Outdated
@@ -83,6 +83,7 @@ Other enhancements | |||
- Add ``"delete_rows"`` option to ``if_exists`` argument in :meth:`DataFrame.to_sql` deleting all records of the table before inserting data (:issue:`37210`). | |||
- Added half-year offset classes :class:`HalfYearBegin`, :class:`HalfYearEnd`, :class:`BHalfYearBegin` and :class:`BHalfYearEnd` (:issue:`60928`) | |||
- Added support to read and write from and to Apache Iceberg tables with the new :func:`read_iceberg` and :meth:`DataFrame.to_iceberg` functions (:issue:`61383`) | |||
- Certain aliases from :py:mod:`pandas._typing` are now exposed in :py:mod:`pandas.api.typing.aliases` (:issue:`55231`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest not advertising where they come from.
- Certain aliases from :py:mod:`pandas._typing` are now exposed in :py:mod:`pandas.api.typing.aliases` (:issue:`55231`) | |
- Many type aliases are now exposed in the new submodule :py:mod:`pandas.api.typing.aliases` (:issue:`55231`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in next commit
Axes, | ||
Axis, | ||
ColspaceArgType, | ||
CompressionOptions, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are many type aliases here where it is not clear what method(s) they are appropriate for. E.g. it would be wrong to use this for DataFrame.to_parquet
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to cover that in the docs, without getting too specific. I can make the docs more specific, although there are cases where the aliases are used in lots of methods, so the list can get quite long. E.g., for CompressionOptions
, I said "Argument type for compression
in many I/O output methods" .
Open to suggestions as to how to better document this.
My suggestion would be that if someone adds an alias to |
pandas/tests/test_api.py:TestApi.test_api_typing_aliases()
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.This is my first proposal for adding the typing aliases that are "public" so that people do not import from
pandas._typing
.