Fix no_modin() always skipping modin tests regardless of import success #12597
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 250 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.331
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #12597"
general
weight: 0.35
RAMitchell
no_modin()decides whethertests/python/test_with_modin.py(5 tests) should be skipped:The final
returnsits outside thetryblock and unconditionally returnscondition: True, so the modin tests are always skipped even when modin imports and constructs aDataFramejust fine. Compare with the neighboringno_matplotlib(), which correctly returnscondition: Falseinside thetryon success.git log -Straces this to #10434 (merged 2024-07-30), which added theDataFramesmoke-test but left the success-path return outside thetry. The original implementation in #6055 and the later refactor in #8379 both had this right.None of the
ops/conda_env/*.ymlfiles install modin (removed in #7996/#8176 due to past modin/pandas version conflicts), so CI'sexcept ImportErrorbranch always fires regardless of this bug — the regression is invisible in CI and only surfaces when modin is installed locally. modin is still a documented, actively-handled input type (compat.py,data.py,doc/python/data_input.rst), so this is 14 months of silently-lost test coverage rather than dead code.Fix: return
condition: Falseon the success path, matchingno_matplotlib().Verified locally with modin 0.37.1 installed:
test_type_check,test_modin_label,test_modin_weight,test_base_marginnow pass, andtest_modin(already marked@pytest.mark.xfail) now XPASSes. Without modin installed, all 5 still skip as before (no change to theexcept ImportErrorpath). Fullpytest tests/pythonwith modin installed: 559 passed, 6 skipped (environment-only: cupy, 128-bit numpy, Linux-only tests, IPv6, scipy array API), 2 xpassed, 0 failed.