-
Notifications
You must be signed in to change notification settings - Fork 176
feat: Improve DataFrame.__getitem__ consistency
#2393
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
MarcoGorelli
merged 97 commits into
narwhals-dev:main
from
MarcoGorelli:better-indexing
Apr 23, 2025
Merged
Changes from all commits
Commits
Show all changes
97 commits
Select commit
Hold shift + click to select a range
264e717
feat: Improve ``DataFrame.__getitem__`` consistency
MarcoGorelli 8bc2bfa
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 2c4f1c1
fixup
MarcoGorelli 01bd787
fixup
MarcoGorelli 86a057c
gather -> _gather
MarcoGorelli 8c216fc
type alias intindexer and strindexer
MarcoGorelli 944b597
reduce diff
MarcoGorelli 6c98cee
naming
MarcoGorelli e080956
Merge remote-tracking branch 'upstream/main' into better-indexing
MarcoGorelli dfbb63f
reduce polars diff
MarcoGorelli 190e265
appease pyright
MarcoGorelli 85940ee
extra test
MarcoGorelli 0d79f24
arrow negative slicing
MarcoGorelli 93110ef
old pyarrow compat
MarcoGorelli 4788a47
old polars compat
MarcoGorelli 2f26c45
pandas fixup
MarcoGorelli d9c619e
refactor: Reuse `CompliantSeries._is_native`
dangotbanned 2929efb
Merge branch 'better-indexing' of https://github.com/marcogorelli/narβ¦
dangotbanned 9317d7a
test and cover slicing dataframe with series
MarcoGorelli 2c30a0c
Merge branch 'better-indexing' of github.com:MarcoGorelli/narwhals inβ¦
MarcoGorelli 16a625b
old polars fixup
MarcoGorelli 19e2762
avoid tolist in old polars
MarcoGorelli 0bc31fc
`is_null_slice` typing
dangotbanned 6bc8532
Merge branch 'better-indexing' of https://github.com/marcogorelli/narβ¦
dangotbanned 426f453
Revert "avoid tolist in old polars"
MarcoGorelli 40d552c
`is_sequence_like` typing
dangotbanned de06d26
avoid is_sequence_like_ints("") false positive
MarcoGorelli 007795b
t push
MarcoGorelli e26c6d1
Merge branch 'main' into better-indexing
dangotbanned b503c2f
fix(typing): Resolve `PolarsSeries` issues
dangotbanned d3b0224
feat(typing): Add `__getitem__` aliases from polars
dangotbanned 20f61fc
feat: Clone `polars` overloads
dangotbanned 42d5a4e
backport `v1`
dangotbanned 6941029
unhide typing issues
dangotbanned f4aed5f
chore: Remove `BooleanMask`
dangotbanned f05c3a2
chore(typing): Fixing `DataFrame.__getitem__`
dangotbanned 1cf8ea8
refactor: Merge branches
dangotbanned 147dbac
early return even earlier π
dangotbanned 203376d
Merge remote-tracking branch 'upstream/main' into pr/MarcoGorelli/2393
dangotbanned 46be441
feat(typing): Slice-typing
dangotbanned e235649
Merge remote-tracking branch 'upstream/main' into pr/MarcoGorelli/2393
dangotbanned 6386996
Merge remote-tracking branch 'upstream/main' into pr/MarcoGorelli/2393
dangotbanned 7a75fb2
fix: `get_column` rename
dangotbanned d24f1b7
pass compliant down instead of native
MarcoGorelli e29c2c6
Merge remote-tracking branch 'upstream/main' into better-indexing
MarcoGorelli e85a1ad
old polars fixup
MarcoGorelli 037c9d7
type __getitem__
MarcoGorelli 0fcbcad
fix modern polars too :sunglasses:
MarcoGorelli 6d2c1aa
log type
MarcoGorelli 5b3cfef
allow slicing Series with native objects
MarcoGorelli 2791f49
coverage
MarcoGorelli 498d6a4
extra test
MarcoGorelli 80bc093
uurgh undo accidental change
MarcoGorelli 5fcc35b
pyright, simplify
MarcoGorelli 9591d10
_arrow/series.py typing
MarcoGorelli b43feae
refactor(typing): Add `_SliceName`, reuse `_Slice` for `_SliceIndex`
dangotbanned f5ab0ab
chore(typing): Unhide some issues
dangotbanned 1aa04be
chore: reorganise aliases
dangotbanned 7465b90
refactor: More matching aliases to guards
dangotbanned de2d9ba
revert(typing): Remove every new `cast`
dangotbanned 9fec62d
fix: `range` != `slice`
dangotbanned 156037f
fix(typing): `EagerDataFrame.__getitem__` exhaustive happy
dangotbanned 7f864c5
chore(typing): Update some signatures
dangotbanned 4276779
fix(typing): Some `PolarsDataFrame` progress
dangotbanned 7a579d3
fix(typing): `Series` allows `_NumpyScalar`
dangotbanned e07be8b
Merge branch 'main' into better-indexing
dangotbanned ff6f2eb
refactor: Don't pass down numpy scalar
dangotbanned 6e00a4a
Merge branch 'main' into better-indexing
dangotbanned 7edc0ca
fix: Narrow correctly in `DataFrame.__getitem__`
dangotbanned becdc48
fix a mypy
dangotbanned c29ecfd
silence some _polars/_arrow type errors for now
MarcoGorelli dc71fd9
extra tests, align polars logic more
MarcoGorelli 693c4eb
Start making generic
dangotbanned bd62c62
Merge branch 'better-indexing' of https://github.com/marcogorelli/narβ¦
dangotbanned 02cc607
:party: remove many unneded assumes from hypothesis test
MarcoGorelli f193a29
Merge branch 'better-indexing' of github.com:MarcoGorelli/narwhals inβ¦
MarcoGorelli e68ee9b
fill in some holes
dangotbanned 17538d3
remove outdated comment
MarcoGorelli f9f84fe
Merge branch 'better-indexing' of github.com:MarcoGorelli/narwhals inβ¦
MarcoGorelli 2a5e866
more updating annotations
dangotbanned af8f152
Merge branch 'better-indexing' of https://github.com/marcogorelli/narβ¦
dangotbanned 308e197
feat(typing): Add `NativeSeriesT` to `EagerDataFrame`
dangotbanned 8e567d5
chore(typing): Update `polars` ignores
dangotbanned 9a2f890
docs(typing): Add note on `pa.Table.select`
dangotbanned 2c01007
refactor: More align names
dangotbanned 1119ad7
refactor: Factor-in `_pandas_like.utils.convert_str_slice_to_int_slice`
dangotbanned b6aec59
remove outdated comment, type CompliantSeies.__getitem__
MarcoGorelli f87422e
more consistent naming
MarcoGorelli 230ce6d
remove another Any + dead code
MarcoGorelli 8355ce5
Merge remote-tracking branch 'origin-token/better-indexing' into bettβ¦
MarcoGorelli 427c9c9
remove dead code
MarcoGorelli dc448ed
fill in Any annotation
MarcoGorelli e8e5a8a
better typing in _polars
MarcoGorelli bfb1cf0
yay figured out the pyright error :party:
MarcoGorelli b725606
remove incorrect Sequence[str]
MarcoGorelli 98fe850
fixup pyright
MarcoGorelli 5b02b59
coverage again
MarcoGorelli 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
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.
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.