TST Fix CI: mark check_all_zero_sample_weights_error as expected failure - #101
Merged
Conversation
scikit-learn's check_all_zero_sample_weights_error expects fit to raise a ValueError when all sample weights are zero. himalaya intentionally allows fitting with all-zero sample weights (see test_kernel_ridge_sample_weight_basic), so the kernel estimators fail this check under newer scikit-learn versions (observed on Python 3.11/3.12 in CI). Add the check to expected_failed_checks for all kernel estimators so it is reported as a documented xfail rather than a CI failure.
There was a problem hiding this comment.
Code Review
This pull request updates the expected_failed_checks function in himalaya/kernel_ridge/tests/test_sklearn_api_kernel.py to include check_all_zero_sample_weights_error as an expected failed check for all estimators. This is because himalaya intentionally allows fitting with all-zero sample weights instead of raising a ValueError. There are no review comments, so I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
The
run-testsjobs on Python 3.11 and 3.12 (e.g. on #100) fail with 8 errors, all of the form:These failures are unrelated to the codecov-action bump in #100 — they are pre-existing on
mainand only surface on Python 3.11/3.12 because those jobs install a newer scikit-learn (≥1.6) that added thecheck_all_zero_sample_weights_errorestimator check.That check expects
fitto raise aValueErrorwhen all sample weights are zero. himalaya intentionally allows fitting with all-zero sample weights — seetest_kernel_ridge_sample_weight_basic, which explicitly asserts that this does not raise. So rather than changing estimator behavior, this marks the check as a documented expected failure via the existingexpected_failed_checksmechanism (sklearn ≥1.6's replacement for_xfail_checks).Changes
expected_failed_checksintest_sklearn_api_kernel.pyto markcheck_all_zero_sample_weights_erroras an expected failure for all four kernel estimators (KernelRidge_,KernelRidgeCV_,MultipleKernelRidgeCV_,WeightedKernelRidge_).The ridge estimators don't need this — scikit-learn does not generate that check for them.
Verification
Reproduced the 8 failures locally with scikit-learn 1.9.0, then confirmed they become clean
xfails after the change. The full numpy-backendtest_check_estimatorsuite passes with no failures.🤖 Generated with Claude Code
Generated by Claude Code