From 4fc13b50795ef9990a4aa31d8a7de03f47313d29 Mon Sep 17 00:00:00 2001 From: ethanglaser Date: Wed, 9 Sep 2026 19:44:40 -0700 Subject: [PATCH] Guard n_jobs access after conditional column drop #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 --- sklbench/report/compatibility.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sklbench/report/compatibility.py b/sklbench/report/compatibility.py index b482237b..303c7d14 100644 --- a/sklbench/report/compatibility.py +++ b/sklbench/report/compatibility.py @@ -50,7 +50,7 @@ def transform_results_to_compatible(results: pd.DataFrame): ], ) # auto-assigned `n_jobs` drop for different CPUs - if results["n_jobs"].unique().size > 1: + if "n_jobs" in results.columns and results["n_jobs"].unique().size > 1: results.drop( inplace=True, errors="ignore",