Guard n_jobs access after conditional column drop - #223
Merged
ethanglaser merged 1 commit intoSep 10, 2026
Conversation
IntelPython#219 added a block that drops the `n_jobs` column when it is partially NaN, but the pre-existing access below it was left unguarded, so any `--compatibility-mode` report over more than one environment_name raises KeyError: 'n_jobs'. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
7 tasks
avolkov-intel
approved these changes
Sep 10, 2026
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.
Description
Fixes a crash in
--compatibility-modereport generation introduced by #219.#219 added a block that drops the
n_jobscolumn when it is partially NaN:The pre-existing access below it (added in #184) was left unguarded, so once
the column is dropped,
transform_results_to_compatibleraisesKeyError: 'n_jobs'.Three conditions are needed to trigger it, which is why it wasn't caught:
--compatibility-mode— the only caller oftransform_results_to_compatiblen_jobspartially NaN, so the new block drops it. True for any full-suiterun, since
LinearRegression/kNN/ensemble carryn_jobswhileRidge/Lasso/ElasticNetdo not.environment_name— true when comparing a measurements fileagainst a baseline captured on another environment.
Observed on a nightly benchmark report comparing current SPR measurements
against the
sklearnex_performance_SPR_2026.1.0baseline.🤖 Generated with Claude Code