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

REF: avoid _with_infer constructor #50001

Merged
merged 7 commits into from
Dec 3, 2022

Conversation

jbrockmendel
Copy link
Member

Trying to get down to Just One constructor.

Copy link
Member

@WillAyd WillAyd left a comment

Choose a reason for hiding this comment

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

looks good

@@ -1144,7 +1143,7 @@ def _convert_categorical(from_frame: DataFrame) -> DataFrame:
if is_categorical_dtype(ser.dtype):
cat = ser._values.remove_unused_categories()
if cat.categories.dtype == object:
categories = ensure_index(cat.categories._values)
categories = pd.Index._with_infer(cat.categories._values)
Copy link
Member

Choose a reason for hiding this comment

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

Is this supposed to have _with_infer still?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes

@mroeschke mroeschke added Refactor Internal refactoring of code Constructors Series/DataFrame/Index/pd.array Constructors labels Dec 2, 2022
@mroeschke mroeschke added this to the 2.0 milestone Dec 3, 2022
Copy link
Member

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

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

LGTM merge when ready @WillAyd

@WillAyd WillAyd merged commit a85a386 into pandas-dev:main Dec 3, 2022
@WillAyd
Copy link
Member

WillAyd commented Dec 3, 2022

Thanks @jbrockmendel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Constructors Series/DataFrame/Index/pd.array Constructors Refactor Internal refactoring of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants