You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(freshcore): fall back when native casts create columns the kernels mishandle (#422)
The adapter's input checks only see the input dtypes, but FreshCore's
native fix_dtypes stage casts text columns before imputation and outlier
detection run. Two casts reach known kernel gaps:
- "yes"/"no" text with missing values becomes a boolean column, which the
native imputer skips, so mode/auto imputation leaves it unfilled while
pandas fills it.
- numeric text holding "inf" becomes a float column holding inf, which the
native fences do not exclude, so zscore/iqr flag nothing while pandas
drops inf before fencing.
After the native run, the adapter now checks the returned column dtypes for
text columns cast to bool or float. When a cast column hits either gap, it
records a fallback naming the column (step "impute" or "outliers") and reruns
on pandas. Under fallback_policy="error" it raises FallbackError. The scan
covers only cast columns and runs only when impute or outliers is set, so
other frames stay native.
Copy file name to clipboardExpand all lines: docs/fallback-matrix.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,10 +26,12 @@ FreshCore also runs its own config and data checks in
26
26
| detection-only dedup (`drop_duplicates=False`) with `duplicate_ratio_action="error"`| native | native | native | native (pandas with native modules that don't report `duplicates_detected`) | the escalation needs the duplicate-row count at the pandas dedup stage; FreshCore counts it natively, but modules built before that count existed would never raise |
| impute `mode`/`auto` with missing values in a nullable `boolean` column | native | native | native | pandas | FreshCore v1 kernels do not impute boolean columns |
29
+
| impute `mode`/`auto` when `fix_dtypes` casts a text column (e.g. `"yes"`/`"no"`) to boolean and it still has missing values | native | native | native | pandas | same kernel gap as above, but the column only becomes boolean inside the native run, so the adapter checks the native result (`fallback_step="impute"`) and reruns on pandas |
29
30
| per-column `impute_strategy`| pandas | pandas | pandas | pandas | unimplemented natively (no fundamental blocker) |
| outliers when a float column holds `±inf`| native | native | native | pandas | FreshCore v1 fences don't exclude non-finite values, so they flag or clip nothing |
34
+
| outliers when `fix_dtypes` casts a text column holding `"inf"`/`"-inf"` to float | native | native | native | pandas | same fence gap as above, but the infinity only appears inside the native run, so the adapter checks the native result (`fallback_step="outliers"`) and reruns on pandas |
0 commit comments