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

GH1037 Remove na_sentinel from factorize methods #1038

Merged
merged 5 commits into from
Nov 22, 2024

Conversation

loicdiridollou
Copy link
Contributor

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

To close the issue, you will have to also edit pandas-stubs/core/base.pyi as well. Basically anywhere that def factorize() appears, and then reconcile it with the docs.

pandas-stubs/core/arrays/base.pyi Outdated Show resolved Hide resolved
tests/test_pandas.py Outdated Show resolved Hide resolved
@loicdiridollou
Copy link
Contributor Author

All should align with the docs now, let me know if anything extra is needed.

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

can you also update core/base.pyi that has a the declaration for Index.factorize() ?

@loicdiridollou
Copy link
Contributor Author

loicdiridollou commented Nov 21, 2024

Aahh I see what you mean, sorry I got confused, added a test on the side, the type hinting seems a bit broad on it but that is for another day.
Now it aligns with the docs https://pandas.pydata.org/docs/reference/api/pandas.Index.factorize.html#pandas.Index.factorize

Copy link
Collaborator

@Dr-Irv Dr-Irv left a comment

Choose a reason for hiding this comment

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

@Dr-Irv Dr-Irv merged commit 47fc9b6 into pandas-dev:main Nov 22, 2024
10 checks passed
@loicdiridollou loicdiridollou deleted the gh1037_na_sentinel_factorize branch December 14, 2024 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Removed na_sentinel argument from factorize(), Index.factorize(), and ExtensionArray.factorize()
2 participants