Skip to content

fix(preprocessor): clear the stale mark after a successful fit - #139

Open
xillig wants to merge 1 commit into
OpenTabular:mainfrom
xillig:fix/lifecycle-stale-after-fit
Open

xillig wants to merge 1 commit into
OpenTabular:mainfrom
xillig:fix/lifecycle-stale-after-fit

Conversation

@xillig

@xillig xillig commented Nov 11, 2026

Copy link
Copy Markdown

Problem

mark_stale() flags the current fitted state as outdated. Fitting the same object again replaced that state, but lifecycle_state_ kept reporting STALE with the old reason.

pre = Preprocessor().fit(df, y)
pre.mark_stale("drift")
pre.fit(df_new, y_new)
pre.lifecycle_state_  # 'STALE', expected 'FITTED'

Fix

A successful fit removes the mark; a fit that raises keeps it. The attribute is removed rather than reset to None, so to_spec() and fingerprint_ of a never-stale preprocessor are unchanged. FROZEN handling is untouched.

Tests and docs

Five tests in tests/integration/test_frozen_lifecycle.py (fit, fit_transform, failed fit, unchanged spec / fingerprint, spec round trip); the mark_stale docstring and reproducibility.md are updated.

Validation

Checks: full suite (2549 passed, 59 skipped, 7 xfailed, coverage >= 94.79%), ruff format / ruff check, pyright (no new diagnostics), docs build with -W, scripts/quickstart.py. Merges cleanly with main and with #136.

mark_stale() flags the current fitted state as outdated. Fitting the same
object again replaced that state, but lifecycle_state_ kept reporting
STALE with the old reason, so a freshly fitted preprocessor looked
unusable.

A successful fit now removes the mark and the state returns to FITTED. A
fit that raises leaves the mark in place. The attribute is removed rather
than reset, so the spec and fingerprint of a never-stale preprocessor are
unchanged.

This branch has not been deployed

No deployments
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.

1 participant