← Back to Pull requests

Fix no_modin() always skipping modin tests regardless of import success #12597

Closed
unknown closed this pull request without merging on Sep 23, 2026 09:59 UTC
View on GitHub
unknown unknown commented on Sep 22, 2026 21:54 UTC
Author

no_modin() decides whether tests/python/test_with_modin.py (5 tests) should be skipped:

def no_modin() -> PytestSkip:
    try:
        import modin.pandas as md
        md.DataFrame([[1, 2.0, True], [2, 3.0, False]], columns=["a", "b", "c"])
    except ImportError:
        return {"reason": "Failed import modin.", "condition": True}
    return {"reason": "Failed import modin.", "condition": True}

The final return sits outside the try block and unconditionally returns condition: True, so the modin tests are always skipped even when modin imports and constructs a DataFrame just fine. Compare with the neighboring no_matplotlib(), which correctly returns condition: False inside the try on success.

git log -S traces this to #10434 (merged 2024-07-30), which added the DataFrame smoke-test but left the success-path return outside the try. The original implementation in #6055 and the later refactor in #8379 both had this right.

None of the ops/conda_env/*.yml files install modin (removed in #7996/#8176 due to past modin/pandas version conflicts), so CI's except ImportError branch 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: False on the success path, matching no_matplotlib().

Verified locally with modin 0.37.1 installed: test_type_check, test_modin_label, test_modin_weight, test_base_margin now pass, and test_modin (already marked @pytest.mark.xfail) now XPASSes. Without modin installed, all 5 still skip as before (no change to the except ImportError path). Full pytest tests/python with modin installed: 559 passed, 6 skipped (environment-only: cupy, 128-bit numpy, Linux-only tests, IPv6, scipy array API), 2 xpassed, 0 failed.

Diff: 250 lines (+187 / -63) across 3 files Reviewer: RAMitchell Review duration: 724m
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
0.39
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 39.0% (MEDIUM) · Higher = larger blast radius
39.0%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.4% · Safe to merge
15.4%
Repository