-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[python-package] Add categorical support for Polars/Arrow via Narwhals #7343
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
Open
maxzw
wants to merge
51
commits into
lightgbm-org:main
Choose a base branch
from
maxzw:feat/narwhals-generic-categorical-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 48 commits
Commits
Show all changes
51 commits
Select commit
Hold shift + click to select a range
09d2ddf
Add categorical support for narwhals-supported dataframe backends
maxzw a208c74
bump minimum narwhals to 2.11
maxzw 9ba05ee
Remove filterwarnings decorator
maxzw fb885f0
Simplify flow
maxzw 243e6ad
Add comment on pandas-numpy zero-copy path
maxzw ba5df42
Clarify comment
maxzw 2054aeb
Fix issue with different categories in train/valid
maxzw 9d35391
Simplify comment
maxzw 6442351
Add categorical tests for pyarrow
maxzw ef34647
Use fixture to isolate per-test categorical string cache
maxzw 766393b
Simplify polars tests by using random method for category scope
maxzw 98791af
Support unobserved categories in Enum dtype
maxzw ee75ef9
Skip tests for polars < 1.32
maxzw e71dfe9
Lint
maxzw 48a3b06
Also run polars tests for python 3.10
maxzw b73b148
More simplifications
maxzw 84a09b7
Update documentation
maxzw e6e5214
Add generic dtype validation for Narwhals supported backends
maxzw afe37d8
Shorten PeriodDtype test case
maxzw 0717bc9
Add SparseDtype test case
maxzw a4e7e09
Bump Narwhals to 2.23.0
maxzw cc434ec
Simplify dtype validation
maxzw 69141e5
Move test_narwhals_dtype_validation_for_pandas to test_pandas.py
maxzw c296814
Rename valid/invalid to supported/unsupported
maxzw 84c978a
Revert to Narwhals bump v2.11.0, and add workarounds for edge cases
maxzw a416b17
Merge branch 'master' into feat/narwhals-generic-categorical-support
maxzw 817d82c
Merge branch 'main' into feat/narwhals-generic-categorical-support
maxzw e525749
Simplify tests
maxzw 9c5f854
Add comment
maxzw 0e8d559
Simplify changes documentation
maxzw 975fa74
Remove unnecessary cast to set
maxzw 1c11624
Fix leakage for global polars categoricals
maxzw de94391
Address minor comments
maxzw a1e5464
Use is_pandas instead of is_pandas_like
maxzw 41232a3
Merge branch 'main' into feat/narwhals-generic-categorical-support
maxzw 626df36
Merge main
maxzw cc47702
Batch cat to code conversions
maxzw 044341e
Use column selector and remove recast
maxzw bd33be7
Correctly handle null values in categorical columns
maxzw 529f02b
Parametrize pandas for null/nan test cases
maxzw 1d2f5c1
Simplify extracting pandas_categorical with minimal relative overhead
maxzw 8e3bd2a
Handle ordered/unordered categories uniformly across dataframe backends
maxzw a69745a
Merge branch 'main' into feat/narwhals-generic-categorical-support
maxzw bf3815b
Use proper typing of data in _data_from_narwhals
maxzw 21ba21d
Merge main
maxzw 1dd38e9
Comments
maxzw 521bbe4
Sort with expression
maxzw fc10ed7
Align tests
maxzw 3df5ae1
Reorder _check_for_bad_narwhals_dtypes - put pandas at the top
maxzw f91a636
Simplify narwhals version
maxzw d7e94d7
Merge branch 'main' into feat/narwhals-generic-categorical-support
maxzw 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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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.