Skip to content

[ci] adapt to scikit-learn ClassifierChain changes, fix {fs} install, work around pyarrow type-checking issues#7236

Merged
jameslamb merged 3 commits intomasterfrom
misc/fix-sklearn
Apr 23, 2026
Merged

[ci] adapt to scikit-learn ClassifierChain changes, fix {fs} install, work around pyarrow type-checking issues#7236
jameslamb merged 3 commits intomasterfrom
misc/fix-sklearn

Conversation

@jameslamb
Copy link
Copy Markdown
Member

@jameslamb jameslamb commented Apr 21, 2026

Another day, more broken CI 😅

Fixes #7238

Fixes #7235

Fixes #7208 (again)

See those issues for details.

@jameslamb
Copy link
Copy Markdown
Member Author

jameslamb commented Apr 21, 2026

mypy is now failing like this:

mypy.....................................................................Failed
- hook id: mypy
- duration: 6.4s
- exit code: 1

python-package/lightgbm/basic.py:3118: error: Module has no attribute "all"  [attr-defined]
python-package/lightgbm/basic.py:3118: error: Module has no attribute "equal"  [attr-defined]
Found 2 errors in 1 file (checked 9 source files)

(build link)

Probably related to pyarrow 24.0 being pushed a few hours ago: https://pypi.org/project/pyarrow/24.0.0/

I won't be able to return to this until maybe 12 hours from now, so if other maintainers look before I do, please feel free to just push directly to my PR here. Otherwise, I'll try to fix this later.


update (Apr 21): documented in #7238, workaround pushed here**

@jameslamb jameslamb changed the title WIP: [ci] adapt to scikit-learn ClassifierChain changes, fix {fs} install WIP: [ci] adapt to scikit-learn ClassifierChain changes, fix {fs} install, work around pyarrow type-checking issues Apr 21, 2026
@jameslamb jameslamb changed the title WIP: [ci] adapt to scikit-learn ClassifierChain changes, fix {fs} install, work around pyarrow type-checking issues [ci] adapt to scikit-learn ClassifierChain changes, fix {fs} install, work around pyarrow type-checking issues Apr 21, 2026
@jameslamb jameslamb marked this pull request as ready for review April 21, 2026 22:02
@jameslamb
Copy link
Copy Markdown
Member Author

Ok this is finally passing! I think it will resolve all of our current CI-blocking issues.

Copy link
Copy Markdown
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.

Thanks for the fix!

Comment on lines +3118 to +3119
# TODO: remove 'type: ignore[attr-defined]' when https://github.com/apache/arrow/issues/49831 is resolved.
if pa_compute.all(pa_compute.equal(weight, 1)).as_py(): # type: ignore[attr-defined]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Just an fyi because of the TODO comment: I'm still planning on unifying our data frame intake processing via Narwhals at some point; this would alleviate the need for this.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks for the comment.

I'm a bit skeptical of a narwhals dependency in lightgbm. We have so little data frame manipulation here (mostly just read-only access to types, size, and the underlying data), I'm unsure that narwhals will bring enough simplification or other benefits to justify adding a dependency and all the burden that comes with that (including effectively losing control of our minimum pandas and pyarrow versions).

But I'm willing to be convinced! And anyway, we can continue that conversation on a draft PR or #6204

@jameslamb jameslamb merged commit 4472f39 into master Apr 23, 2026
66 checks passed
@jameslamb jameslamb deleted the misc/fix-sklearn branch April 23, 2026 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

2 participants