Skip to content

Remove UnivariateDriftCalculator from codebase#113

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-112
Draft

Remove UnivariateDriftCalculator from codebase#113
Copilot wants to merge 2 commits intomainfrom
copilot/fix-112

Conversation

Copy link
Contributor

Copilot AI commented Jun 10, 2025

This PR removes the UnivariateDriftCalculator class from the codebase as it was only used internally and provides overlapping functionality with the existing DriftCalculator class.

Changes Made

  • Removed UnivariateDriftCalculator class from tab_right/drift/univariate.py (122 lines)
  • Refactored detect_univariate_drift_df() to implement the logic directly instead of using the class
  • Removed 6 test functions that specifically tested UnivariateDriftCalculator (69 lines)
  • Cleaned up imports by removing unused dataclass and Union imports

Benefits

  • Cleaner codebase: Eliminates redundant drift detection implementation
  • Reduced maintenance burden: One less class to maintain and document
  • Preserved public API: All existing functions (detect_univariate_drift, detect_univariate_drift_df, etc.) work identically
  • No breaking changes: Documentation examples and notebooks continue to work without modification

Verification

  • ✅ All 130 tests pass
  • ✅ Code passes linting checks
  • ✅ Public API behavior preserved for all scenarios:
    # These continue to work exactly as before
    detect_univariate_drift_df(df1, df2)  # auto detection
    detect_univariate_drift_df(df1, df2, kind="continuous")  # forced type
    detect_univariate_drift(series1, series2)  # individual series

The DriftCalculator class remains available for users who need object-oriented drift analysis, while the functional APIs provide a simpler interface for most use cases.

Fixes #112.

Co-authored-by: eh-main-bot <171766998+eh-main-bot@users.noreply.github.com>
Copilot AI changed the title [WIP] Remove UnivariateDriftCalculator from codebase Remove UnivariateDriftCalculator from codebase Jun 10, 2025
Copilot AI requested a review from EH-MLS June 10, 2025 15:17
@codecov
Copy link

codecov bot commented Jun 10, 2025

Codecov Report

Attention: Patch coverage is 88.88889% with 2 lines in your changes missing coverage. Please review.

Project coverage is 95.76%. Comparing base (d5203cc) to head (9c3bd3e).

Files with missing lines Patch % Lines
tab_right/drift/univariate.py 88.88% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #113      +/-   ##
==========================================
- Coverage   95.78%   95.76%   -0.03%     
==========================================
  Files          19       19              
  Lines         736      708      -28     
==========================================
- Hits          705      678      -27     
+ Misses         31       30       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove UnivariateDriftCalculator from codebase

2 participants