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

Fix Series#get and DataFrame#get #867

Merged
merged 6 commits into from
Feb 13, 2024
Merged

Conversation

skatsuta
Copy link
Contributor

Fix Series#get and DataFrame#get to resolve #808.

@skatsuta skatsuta marked this pull request as ready for review February 12, 2024 11:27
@skatsuta skatsuta force-pushed the issue-808 branch 2 times, most recently from f842696 to 67453a5 Compare February 12, 2024 11:57
pandas-stubs/core/frame.pyi Outdated Show resolved Hide resolved
pandas-stubs/core/frame.pyi Outdated Show resolved Hide resolved
pandas-stubs/core/frame.pyi Outdated Show resolved Hide resolved
pandas-stubs/core/series.pyi Outdated Show resolved Hide resolved
pandas-stubs/core/series.pyi Outdated Show resolved Hide resolved
tests/test_frame.py Show resolved Hide resolved
Copy link
Contributor Author

@skatsuta skatsuta 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 Thanks for your suggestions.

Added the following changes:

  • Used _typing.T instead of locally defined type vars
  • Removed = ... from the overloads for cases where the default parameter is specified
  • Split Series#get(..., default: S1) -> S1 and Series#get(..., default: T) -> S1 | T
  • Added test cases for when the default parameter is None and no key is found

pandas-stubs/core/frame.pyi Show resolved Hide resolved
@skatsuta skatsuta requested a review from Dr-Irv February 13, 2024 14:29
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.

thanks @skatsuta

@Dr-Irv Dr-Irv merged commit 7978238 into pandas-dev:main Feb 13, 2024
13 checks passed
@skatsuta skatsuta deleted the issue-808 branch February 13, 2024 14:37
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.

pd.Series.get causes typing error in second argument (default value)
2 participants