-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: pandas/core #27522
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
Is there anything outside of the top level pandas namespace that is public? I know we have some usages of |
I share Will's sentiment, though from looking at the history it seems like there was an intentional move away from that before I got here. If there is a shuffling of core files, I'd like to separate out Index/Series/DataFrame/internals from lower-level code that doesn't need to be "aware" of these classes |
nothing should be public except pd namespace we moved everything a few years ago to create _libs and consolidate under core & io moving things around is much much easier after |
So sounds like we need to:
Then actually prefix those namespaces with an underscore to privatize? |
Hi, it will be nice to also expose exceptions raised by top level functions, since downstream may want to handle them in their own code. Use case: aliyun/aliyun-odps-python-sdk#99 |
this may warrant a separate issue for discussion. @jorisvandenbossche what's you current feeling regarding custom exceptions exposed to users? #25569 (comment) |
these are already mostly in pandas.exceptions which are public |
is this an exception (sorry for the pun) to the "nothing should be public except pd namespace" rule? |
yes |
pandas.api as well; the other top level packages should be private (though may be tricky / take a while to fully remove) |
Since we're re-having this discussion, I'll note that if we're disciplined
about making private modules private with a leading underscore,
there's no need for a `.api` namespace. Everything not starting with an
underscore is public.
pandas.arrays
pandas.exceptions
pandas.extensions
pandas.types
...
Tom
…On Tue, Jul 23, 2019 at 6:05 AM Jeff Reback ***@***.***> wrote:
pandas.api as well; the other top level packages should be private (though
may be tricky / take a while to fully remove)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#27522?email_source=notifications&email_token=AAKAOIWYVSQLPXERGTM4CYDQA3QZLA5CNFSM4IFZ7I52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2SYILY#issuecomment-514163759>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKAOIUKLCDVQIM2YQCLMYTQA3QZLANCNFSM4IFZ7I5Q>
.
|
Then, Anyway, it's better to have them in one and fixed place. |
it looks like this was added in #19790 and intended to be user facing. so it probably should be in the public api. can you raise an issue for this. |
#27553 submitted |
I think it has become clear from the discussion, but to put it explicitly: this is not really correct (in the meaning of "only objects and functions in the pd namespace"). All submodules in the pd namespace are also (partly) public (and the objects they contain), except for I think the main confusing situation are those submodules that are only partly public (io and tseries), the objects of them we list in the API docs as public:
To say that From the explicitly documented as private modules (core, compat, util), I think it is mainly For the custom expections that are not included in |
I don't have a strong preference for what we do, but I would like to be
consistent. So we shouldn't move just `pd.io.json.json_normalize` to the
top-level, but not `pd.io.json.build_table_schema`.
…On Tue, Jul 30, 2019 at 5:22 AM Joris Van den Bossche < ***@***.***> wrote:
nothing should be public except pd namespace
I think it has become clear from the discussion, but to put it explicitly:
this is not really correct (in the meaning of "only objects and functions
in the pd namespace").
All submodules in the pd namespace are also (partly) public (and the
objects they contain), *except* for pandas.core, pandas.util and
pandas.compat. For pandas.io and pandas.tseries this is only "partly", as
we say in the docs that for those submodules only those objects are public
which are listed in the API docs. But so the arrays, errors, plotting and
testing modules are fully public.
See the docs on this:
https://pandas.pydata.org/pandas-docs/stable/reference/index.html
I think the main confusing situation are those submodules that are only
partly public (io and tseries), the objects of them we list in the API docs
as public:
- pandas.io:
- mentioned in the API reference:
- pandas.io.json: json_normalize, build_table_schema
- pandas.io.formats.style: Styler
- also used in the user guide: pd.io.sql.execute (and
pd.io.sql.get_schema always had a somewhat dubious status) and
pd.io.date_converters.parse_date_time
- pandas.tseries:
- mentioned in the API reference:
- pandas.tseries.offsets: DateOffset, Tick, and all their
subclasses
- pandas.tseries.frequencies: to_offset
- also used in the user guide: several objects from
pandas.tseries.holiday
- Additional note: in the user guide we use pd.offsets and not
pd.tseries.offsets as in the reference guide, something we should
make consistent.
To say that json_normalize is far from the only non-top-level function.
From the explicitly documented as private modules (core, compat, util), I
think it is mainly pd.util.testing that actually sees quite some usage in
the wild. Not sure if we want to do something about this. We moved some to
pandas.testing, but I think people use more than what we exposed there
(eg several "create dataframe" functions).
For the custom expections that are not included in pandas.errors, I
opened #27656 <#27656> (there
are quite a few).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#27522?email_source=notifications&email_token=AAKAOIR3GOVDYLBFAT6CDI3QCAI6XA5CNFSM4IFZ7I52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3DQQCI#issuecomment-516360201>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAKAOIXSEBMZHXZQG6XNSILQCAI6XANCNFSM4IFZ7I5Q>
.
|
Is deprecating this a priority for 1.0? According to https://dev.pandas.io/docs/development/policies.html, we're allowed to add depredations in x.y releases, so we can do this after 1.0 if no one has time for it. |
It's not fully clear to me what is actually being proposed here (a lot of the above discussion was about other top-level modules that are actually public). Is it about moving |
yes that’s what we did quite a while ago for the other codebases |
Just FYI, we do have public things currently exposed from |
Moving this off the 1.0 milestone (deprecations are not blockers for 1.0 I think, since they can be introduced in any 1.x release) |
take |
I was thinking this was blocked since @phofl - My recollection is that you had better ideas on how to implement this than I could conjure. Any interest in tackling this at some point as part of 2.x? |
Some general comments:
|
Since we're doing the deprecation very slowly (over 2+ years maybe?), there will be an extended period of time where you can import from either With this, I think it's okay to think of this question as independent of our deprecation of |
IMO, this probably should require a PDEP, given the scope of this deprecation. I missed the last dev call, was something like that discussed there? |
pandas.core is documented as being private. We're deprecating the move because users and downstream packages haven't always followed this, but in my opinion, this isn't technically a user-facing change. |
Even though this doesn't directly affect users, I think it would be good to provide clarity to downstream as to how they should go about replacing the internals from pandas.core they are using, and the timeline for doing so. Making this a PDEP would provide a lot more visibility than just discussing on the issue here. There is also a large impact on contributors to the package as I imagine stuff like renaming |
@pandas-dev/pandas-core - who thinks this does or doesn't need a PDEP. 👍 Needs a PDEP |
Yes, but we do have reference pages that list methods as part of |
To me, this is a compelling reason to do so. Then we have an agreed upon path for the deprecation. I don't think we need a PDEP that is about renaming. We need a PDEP that explains the deprecation process. |
That's what docs are there for |
Yes, but I think we have to agree on that deprecation process before it gets documented (effectively making the core of the PDEP the future documentation), as opposed to doing a PR that has a description of the deprecation process in docs, which we then have a debate over. |
I don't think this needs a PDEP (yet) because:
From the comments so far it appears the deprecation plan needs more clarity/details(?). If the plan gets to a state where there's a gridlock in consensus then I think a PDEP vote would be warranted. Also IMO the best way to get feedback on this procedure from users would be to issue to deprecation as opposed to writing a PDEP |
That's what this issue is for. I've edited the OP here with the process as I currently see it, but will be updating based on feedback. |
Fair enough. Your edits cleared things up. I think the section at the end entitled "Anytime after" could use more precision on the timing. Would those changes in that section be made in a major or minor release? |
we have a documentation note that pandas.core is private but we need an actual deprecation
see discussion starting here: #27471 (comment)
[Edit by rhshadrach] Current outline (will update as this evolves):
Fix redirects due to moving doc pages from DOC: Change core paths to api.typing in URLs #55626 (ref: DOC: Change core paths to api.typing in URLs #55626 (comment))Update: The linked PR has been reverted, no fix is needed.pandas.api.typing
(DOC: Provide a public place for users to link to our documentation #55632)__module__
to all pandas objects pointing to the public location (ENH: set__module__
on top-level public objects #55178)pandas.core
topandas._core
and add in stub files for backwards compatibilitypandas.core
pandas.core
The text was updated successfully, but these errors were encountered: