Repository navigation
fix(freshcore): fall back for missforest, per-column strategies, non-finite outliers and nullable bools; honour native duplicate counts - #375
Merged
Conversation
…finite outliers and nullable bools; honour native duplicate counts The FreshCore adapter ran several configs natively that its v1 kernels silently get wrong. It now delegates them to the pandas reference through the existing fallback path, so fallback_policy="error" raises FallbackError and reports record the event. - impute="missforest" and per-column impute_strategy: the native imputer ignores both, so nothing was filled. _unsupported_reason() now falls back with the same reasons as PlanGenerator.fallback_reason(), so fd.plan() and the recorded event agree. PlanGenerator now treats an empty impute_strategy mapping as a no-op, matching the pandas imputer. - Outliers on float columns holding +/-inf: the native fences don't exclude non-finite values, so zscore and IQR flag or clip nothing. When outliers is set, a vectorised np.isinf scan of float columns triggers a fallback naming the columns. - impute="mode"/"auto" with missing values in a nullable boolean column: the native kernel skips boolean data. Fall back when such a column has some (not all) values missing. - Duplicate ratio: when the native result carries duplicates_detected, the adapter reports it through report_detected_duplicates(), in pandas action order, using the row count after empty-row removal. With drop_duplicates=True, the native drop count goes through check_duplicate_ratio(), so duplicate_ratio_action="error" raises and high ratios warn. A missing key skips detection, except under duplicate_ratio_action="error", where the run falls back so the escalation is not silently lost. The fallback matrix, backends and FreshCore docs list the new triggers. Closes #322 Closes #334 Closes #335 Refs #323 (Python adapter only; the native engine still needs to report duplicates)
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
FreshData benchmark report —
|
| fixture | n_rows | n_cols | p50 s | p95 s | peak MB | repair % | false-repair % | preserve % | trust | monotonic | export % |
|---|
Authored-code reduction (Metric 6)
This was referenced Sep 15, 2026
kevincostner17
added a commit
that referenced
this pull request
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The FreshCore adapter ran several configs natively that its v1 kernels silently get wrong. They now fall back to the pandas reference through the existing fallback path, so
fallback_policy="error"raisesFallbackErrorand reports record the event.impute="missforest"and per-columnimpute_strategyfall back, with the same reasons asPlanGenerator.fallback_reason(), sofd.plan()and the recorded event agree.PlanGeneratornow treats an emptyimpute_strategyas a no-op, like the pandas imputer.outliersis set and a float column holds±inf, the run falls back. Native fences don't exclude non-finite values, so zscore and IQR flagged nothing. The check is a vectorisednp.isinfover float columns.impute="mode"/"auto"falls back when a nullablebooleancolumn has missing values, which the native kernel never fills.duplicates_detected, it goes throughreport_detected_duplicates(), in pandas action order and using the row count after empty-row removal. Withdrop_duplicates=True, the native drop count goes throughcheck_duplicate_ratio(), soduplicate_ratio_action="error"raises and high ratios warn. If the key is missing, detection is skipped, except underduplicate_ratio_action="error", where the run falls back so the escalation isn't lost.docs/fallback-matrix.md,docs/backends.mdanddocs/freshcore.mdlist the new triggers.Known gap: with
fix_dtypes=True, native string casts can still create boolean columns with missing values or float columns holding inf, which the input-dtype checks don't see.Tests
New
tests/test_execution/test_freshcore_fallbacks.py, using a fake native module:fallback_policy="error".fd.plan()shows the same reason as the recorded fallback.duplicates_detectedproduces the pandas detection action, warning and recommendation, and raisesDuplicateRatioErrorunder"error". A missing key skips detection, or falls back under"error".drop_duplicates=Trueescalates and warns like pandas.Verification
ruff check .clean;mypy src/freshdataclean (202 files)srcCloses #322
Closes #334
Closes #335
Refs #323 (Python adapter only; the native engine still needs to report duplicates)