← Back to Pull requests

[GH-3517] [Python] Complete GeoStats type annotations and legacy compatibility re-exports #3506

Closed
unknown closed this pull request without merging on Nov 04, 2026 06:14 UTC
View on GitHub
unknown unknown commented on Oct 28, 2026 13:42 UTC
Author

Did you read the Contributor Guide?

  • Yes, I have read the Contributor Rules and Contributor Development Guide
  • Is this PR related to a ticket?

  • Closes #3517
  • What changes were proposed in this PR?

  • Complete type annotations in sedona.spark.stats.weighting by replacing saved_attributes: List[str] = None with Optional[List[str]] = None across add_distance_band_column, add_binary_distance_band_column, and add_weighted_distance_band_column.

  • Add explicit type annotations (use_spheroid: bool, is_core_column_name: str, cluster_column_name: str, result_column_name: str) and return type annotations (-> DataFrame) to dbscan and local_outlier_factor.

  • Add legacy compatibility deprecation proxy for sedona.stats.autocorrelation and sedona.stats.autocorrelation.moran re-exporting Moran and MoranResult, and re-export all geostats functions in sedona.stats with standard deprecation warnings.
  • How was this patch tested?

  • Verified syntax and bytecode compilation with python3 -m py_compile across all modified modules.
  • Did this PR include necessary documentation updates?

  • No, this PR preserves public APIs and enhances typing and backwards compatibility without altering user-facing behavior.
  • Diff: 170 lines (+127 / -43) across 2 files Reviewer: ShivanshhhG Review duration: 9632m
    All Vouch review confidence checks passed
    Residual risk 0.14 = Change Risk (0.35) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.35 · 170 lines diff across 2 files
    0.35
    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.308
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3506"
    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: 35.2% (MEDIUM) · Higher = larger blast radius
    35.2%
    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: 13.9% · Safe to merge
    13.9%
    Repository