-
-
Notifications
You must be signed in to change notification settings - Fork 141
Public pandas API and pandas-stubs #161
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
Comments
There are a few issues here that come to me right now about this:
|
|
I would prefer removing annotations for deprecated methods: that would also be consistent with for example the keyword-only arguments in |
agree. This was one of the main reasons that I supported a separate pandas-stubs repo. https://mail.python.org/pipermail/pandas-dev/2022-April/001462.html
I think probably much better than the "whack-a-mole" approach even though this method is commonly used and accepted for typing stubs.
yes. any issues on what should/should not be public/private should be discussed on the main repo.
yes and yes. agree with @bashtage #161 (comment). Typing helps identify objects that should be public from the return types. Such as iterators for the IO chunk reads. But then only a few methods of the object would probably be considered public.
n/a given 2.
see response above but ok for now.
agree with @twoertwein #161 (comment) |
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.py
s)cc @Dr-Irv @bashtage @jreback @simonjayhawkins
The text was updated successfully, but these errors were encountered: