-
-
Notifications
You must be signed in to change notification settings - Fork 145
feat(index): append #1282
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
Merged
Dr-Irv
merged 11 commits into
pandas-dev:main
from
cmp0xff:feature/cmp0xff/index-append
Jul 30, 2025
+67
−3
Merged
feat(index): append #1282
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
390e5d9
feat(index): append
cmp0xff 3a34057
fix(comment): https://github.com/pandas-dev/pandas-stubs/pull/1282#di…
cmp0xff 45e0ad3
fix(comment): https://github.com/pandas-dev/pandas-stubs/pull/1282/fi…
cmp0xff 6c8ba76
fix(pyrefly): ignore
cmp0xff 3844062
fix(comment): https://github.com/pandas-dev/pandas-stubs/pull/1282#di…
cmp0xff ac0857b
fix(comment): https://github.com/pandas-dev/pandas-stubs/pull/1282#di…
cmp0xff 67e6bde
fix(comment): https://github.com/pandas-dev/pandas-stubs/pull/1282#di…
cmp0xff fa3c401
fix: Sequence[Index] instead of Sequence
cmp0xff d7a538d
fix(comment): avoid union types https://github.com/pandas-dev/pandas-…
cmp0xff fe5f1a9
chore: https://github.com/pandas-dev/pandas-stubs/pull/1282#discussio…
cmp0xff 1c75df6
fix: constraint instead of bound to get rid of Any https://github.com…
cmp0xff File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ from typing import ( | |
ClassVar, | ||
Literal, | ||
TypeAlias, | ||
TypeVar, | ||
final, | ||
overload, | ||
) | ||
|
@@ -43,6 +44,7 @@ from typing_extensions import ( | |
from pandas._libs.interval import _OrderableT | ||
from pandas._typing import ( | ||
S1, | ||
S2, | ||
AnyAll, | ||
AxesData, | ||
DropKeep, | ||
|
@@ -64,6 +66,8 @@ from pandas._typing import ( | |
type_t, | ||
) | ||
|
||
_T_INDEX = TypeVar("_T_INDEX", bound=Index) # ty: ignore[unresolved-reference] | ||
|
||
class InvalidIndexError(Exception): ... | ||
|
||
class Index(IndexOpsMixin[S1]): | ||
|
@@ -401,7 +405,14 @@ class Index(IndexOpsMixin[S1]): | |
) -> Self: ... | ||
@overload | ||
def __getitem__(self, idx: int | tuple[np_ndarray_anyint, ...]) -> S1: ... | ||
def append(self, other): ... | ||
@overload | ||
def append(self, other: Index[S1] | Sequence[Index[S1]]) -> Self: ... | ||
@overload | ||
def append(self, other: Index[S2] | Sequence[Index[S2]]) -> Index[S1 | S2]: ... | ||
@overload | ||
def append(self, other: Sequence[_T_INDEX]) -> Self | _T_INDEX: ... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why can't we use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea came from #1282 (comment). Removed in 67e6bde. |
||
@overload | ||
def append(self, other: Index | Sequence) -> Index: ... | ||
def putmask(self, mask, value): ... | ||
def equals(self, other) -> bool: ... | ||
@final | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.