Skip to content

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

Merged
jameslamb merged 7 commits intomicrosoft:masterfrom
mlondschien:issue-6780
Jan 11, 2025
Merged

[python-package] Infer feature names from pyarrow.Table#6781
jameslamb merged 7 commits intomicrosoft:masterfrom
mlondschien:issue-6780

Conversation

@mlondschien
Copy link
Contributor

Bugfix for #6780.

@mlondschien
Copy link
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
Contributor Author

@microsoft-github-policy-service agree

Copy link
Collaborator

@borchero borchero left a comment

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
Copy link
Collaborator

@jameslamb jameslamb left a comment

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.

@jameslamb jameslamb self-requested a review January 9, 2025 21:13
@mlondschien
Copy link
Contributor Author

I didn't find any changelog to update.

@jameslamb
Copy link
Collaborator

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.

Copy link
Collaborator

@jameslamb jameslamb left a comment

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']

@jameslamb jameslamb merged commit e61bcbe into microsoft:master Jan 11, 2025
46 checks passed
@github-actions
Copy link
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