Skip to content

TST Fix CI: mark check_all_zero_sample_weights_error as expected failure - #101

Merged
mvdoc merged 1 commit into
mainfrom
claude/pr-100-ci-errors-07fwz2
Jun 8, 2026
Merged

TST Fix CI: mark check_all_zero_sample_weights_error as expected failure#101
mvdoc merged 1 commit into
mainfrom
claude/pr-100-ci-errors-07fwz2

Conversation

@mvdoc

@mvdoc mvdoc commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

The run-tests jobs on Python 3.11 and 3.12 (e.g. on #100) fail with 8 errors, all of the form:

FAILED .../test_sklearn_api_kernel.py::test_check_estimator[...-check_all_zero_sample_weights_error]
  - AssertionError: Did not raise: [<class 'ValueError'>]

These failures are unrelated to the codecov-action bump in #100 — they are pre-existing on main and only surface on Python 3.11/3.12 because those jobs install a newer scikit-learn (≥1.6) that added the check_all_zero_sample_weights_error estimator check.

That check 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, 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 existing expected_failed_checks mechanism (sklearn ≥1.6's replacement for _xfail_checks).

Changes

  • Extend expected_failed_checks in test_sklearn_api_kernel.py to mark check_all_zero_sample_weights_error as 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-backend test_check_estimator suite passes with no failures.

🤖 Generated with Claude Code


Generated by Claude Code

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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.

@mvdoc
mvdoc merged commit c2be6de into main Jun 8, 2026
8 checks passed
@mvdoc
mvdoc deleted the claude/pr-100-ci-errors-07fwz2 branch June 8, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants