Skip to content
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

CLN: remove fastpath & verify_integrity from constructors #20110

Open
3 of 6 tasks
jreback opened this issue Mar 10, 2018 · 7 comments
Open
3 of 6 tasks

CLN: remove fastpath & verify_integrity from constructors #20110

jreback opened this issue Mar 10, 2018 · 7 comments
Labels
Clean Constructors Series/DataFrame/Index/pd.array Constructors Deprecate Functionality to remove in pandas

Comments

@jreback
Copy link
Contributor

jreback commented Mar 10, 2018

this is a top-level issue to remove the fastpath and/or verify_integrity keyword args from constructors from public interfaces, classes such as Categorical, Series, andMultiIndex. If these are removed all once from a particular class, e.g. Index/MultiIndex for verify_integrity, but are still needed for an internal API, then can add an internal constructor _from_fastpath which can serve instead (e.g. see pandas.core.dtypes.dtype.CategoricalDtype for an example of this) There may be some re-factoring required to keep things DRY.

Most of these will actually need to be deprecated.

@jreback jreback added Indexing Related to indexing on series/frames, not to indexes themselves Difficulty Intermediate Clean labels Mar 10, 2018
@jreback jreback added this to the 0.23.0 milestone Mar 10, 2018
@jreback
Copy link
Contributor Author

jreback commented Mar 10, 2018

xref #20017, cc @PoppyBagel

@TomAugspurger
Copy link
Contributor

Pushing to the next release if that's OK.

@TomAugspurger TomAugspurger modified the milestones: 0.23.0, Next Major Release Apr 23, 2018
@jorisvandenbossche jorisvandenbossche modified the milestones: Next Major Release, 0.24.0 Apr 24, 2018
@jorisvandenbossche
Copy link
Member

I added it to 0.24.0 instead of the big pile of "Next major release"

@spacesphere
Copy link
Contributor

@jreback, sorry for the delay with it. Could you, please, clarify some points.
Does this mean that we need to deprecate these arguments first?
Also, unlike with fastpath, it doesn't seem totally clear to me how to deal with verify_integrity (especially in the case of pd.concat/.append). And should it be treated as fastpath in sense of naming?

@TomAugspurger
Copy link
Contributor

Does this mean that we need to deprecate these arguments first?

Yep.

I'm not sure about deprecating verify_integrity.

@jorisvandenbossche
Copy link
Member

I think verify_integrity is a potentially useful public argument, so also not sure about deprecating it.
In any case, I think fastpath is more important, as that is really exposing internal details.

@jreback jreback modified the milestones: 0.24.0, 0.25.0 Nov 6, 2018
@jbrockmendel jbrockmendel added this to DatetimeIndex Issues in DatetimeArray Refactor Nov 16, 2018
@jbrockmendel jbrockmendel moved this from DTI/DTA Constructor Issues to Done in DatetimeArray Refactor Dec 7, 2018
@jorisvandenbossche jorisvandenbossche modified the milestones: 0.25.0, Contributions Welcome Jun 30, 2019
@jbrockmendel jbrockmendel added Constructors Series/DataFrame/Index/pd.array Constructors and removed Indexing Related to indexing on series/frames, not to indexes themselves labels Feb 10, 2020
@mroeschke mroeschke added the Deprecate Functionality to remove in pandas label Jun 28, 2020
@jbrockmendel
Copy link
Member

If we deprecate fastpath in the Series constructor, for perf we'd want to have those cases go through Series._from_mgr, or more specifically self._constructor_sliced._from_mgr. But this will break whenever _constructor_sliced doesn't return a class (eg geopandas IIRC).

There are a couple of potential workarounds

  1. deprecate allowing non-class _constructor_sliced. deprecation path might be tough. downstream could maybe keep old behavior by implementing __new__?
  2. implement DataFrame._from_mgr_sliced that subclasses could override.

@mroeschke mroeschke removed this from the Contributions Welcome milestone Oct 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Clean Constructors Series/DataFrame/Index/pd.array Constructors Deprecate Functionality to remove in pandas
Projects
No open projects
Development

No branches or pull requests

6 participants