Parent
#176
What to build
Add string_sentinels: dict[str, list[str]] as a dataclass field on FittedImputer (default empty dict) and wire it through transform and serialization:
transform(): pass string_sentinels=self.string_sentinels to the existing _resolve_effective_nulls call, so replace-semantics string sentinel normalization happens at transform time on new data — including test-split data in production.
to_dict(): serialize string_sentinels as a plain JSON-compatible dict.
from_dict(): restore string_sentinels; a payload without the key defaults to {} for backwards compatibility with imputers serialized before this feature.
Acceptance criteria
Blocked by
Parent
#176
What to build
Add
string_sentinels: dict[str, list[str]]as a dataclass field onFittedImputer(default empty dict) and wire it through transform and serialization:transform(): passstring_sentinels=self.string_sentinelsto the existing_resolve_effective_nullscall, so replace-semantics string sentinel normalization happens at transform time on new data — including test-split data in production.to_dict(): serializestring_sentinelsas a plain JSON-compatible dict.from_dict(): restorestring_sentinels; a payload without the key defaults to{}for backwards compatibility with imputers serialized before this feature.Acceptance criteria
FittedImputer.string_sentinelsfield exists, defaults to{}transform()calls_resolve_effective_nulls(df, string_sentinels=self.string_sentinels)to_dict()output includes the"string_sentinels"keyfrom_dict()restores the field; a dict without the key deserializes to{}FittedImputerconstructed withstring_sentinels={"status": ["N/A", "missing"]}and serialized viato_dict()/from_dict()produces the sametransform()output as the original object when the test DataFrame contains"N/A"instatusFittedImputerdeserialized from an old-format dict (nostring_sentinelskey) transforms data identically to one constructed withstring_sentinels={}FittedImputerinstances wherestring_sentinelsis emptytests/unit/imputation/test_fitted_imputer.pycovering all criteria aboveBlocked by