Skip to content

[python-package] Infer feature names from pyarrow.Table - #6781

Merged
jameslamb merged 7 commits into
lightgbm-org:masterfrom
mlondschien:issue-6780
Jan 11, 2025
Merged

jameslamb merged 7 commits into
lightgbm-org:masterfrom
mlondschien:issue-6780

Conversation

@mlondschien

Copy link
Copy Markdown
Contributor

Bugfix for #6780.

@mlondschien

Copy link
Copy Markdown
Contributor Author

xref #6782. This bugfix works only if cffi is installed.

@mlondschien
mlondschien marked this pull request as ready for review January 9, 2025 20:17
@mlondschien

Copy link
Copy Markdown
Contributor Author

@microsoft-github-policy-service agree

@borchero borchero left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Once CI passes, this looks good to me, thank you for the fix!

@jameslamb jameslamb added the fix label Jan 9, 2025
@jameslamb jameslamb changed the title Infer feature names from pyarrow.Table [python-package] Infer feature names from pyarrow.Table Jan 9, 2025

@jameslamb jameslamb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for this! I disagree with @borchero though, I don't think this is ready to merge yet. Please see my first round of suggestions.

Comment thread tests/python_package_test/test_arrow.py Resolved
Comment thread tests/python_package_test/test_arrow.py Resolved
Comment thread tests/python_package_test/test_arrow.py Resolved
Comment thread python-package/lightgbm/basic.py Resolved
@jameslamb
jameslamb self-requested a review January 9, 2025 21:13
Comment thread python-package/lightgbm/basic.py Resolved
@mlondschien

Copy link
Copy Markdown
Contributor Author

I didn't find any changelog to update.

@jameslamb

Copy link
Copy Markdown
Member

I didn't find any changelog to update.

Thanks for being thorough. We don't keep a changelog in source control here.

Every pull request is squash merged (1 PR = 1 commit), and the PR titles are used to auto-generate a changelog.

@jameslamb jameslamb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great fix, thank you!

I ran these tests on latest master and confirmed they both fail.

FAILED tests/python_package_test/test_arrow.py::test_arrow_feature_name_auto - TypeError: Wrong type(str) or unknown name(a) in categorical_feature

FAILED tests/python_package_test/test_arrow.py::test_arrow_feature_name_manual - AssertionError: assert ['a', 'b'] == ['c', 'd']

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically locked since there has not been any recent activity since it was closed.
To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jan 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants