Skip to content

fix(streaming): exact large integers and non-string column labels - #221

Merged
kevincostner17 merged 1 commit into
mainfrom
fix/streaming-labels
Sep 14, 2026
Merged

kevincostner17 merged 1 commit into
mainfrom
fix/streaming-labels

Conversation

@kevincostner17

@kevincostner17 kevincostner17 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Summary

#208, streaming part: StreamingCleaner no longer casts nullable Int*/UInt* columns to float64 when filling them from running statistics. That cast changed present values beyond 2**53.

  • Those columns keep their integer dtype and are filled with the rounded running statistic. The report says kept Int64 so values beyond 2**53 stay exact.
  • Running state is float64 by design, so the fill value is only as precise as float64. Present values stay exact.
  • Columns within ±2**53 keep the existing float64 behaviour.

#209: StreamingCleaner.clean_batch and fd.clean_timeseries no longer raise KeyError on non-string column labels.

  • The str form of a label now only keys the running state and report entries. Frame access uses the original label.
  • That covers _impute/_impute_column, detect_drift, and the time-series interpolation, seasonal and anomaly steps. last_numeric_cols and report columns stay strings.

Issue repros on this branch

Output is identical on Python 3.12 / numpy 2.5 and Python 3.9 / pandas 1.5.3:

#208 streaming: Int64 [9007199254740993, 9007199254740992, 9007199254740995, 9007199254740993]
#209 clean_batch: {0: [1.0, 3.0, 3.0, 4.0], 1: [1.0, 2.0, 3.0, 4.0]}
#209 clean_timeseries: ['a', 'a', 'a', 'a']

Tests

  • tests/test_streaming_cleaner.py: integer labels, including a second batch that runs drift detection; an Int64 fill beyond 2**53 keeps the present values and the dtype.
  • tests/test_streaming_timeseries.py: integer labels through fd.clean_timeseries, with interpolation reported under column "8".

Local lane pytest -m "not online and not large" on Python 3.12 and 3.9: all pass except the five sandbox tests that also fail locally on main (they need an installed package). ruff check . and mypy src/freshdata pass.

Closes #208
Closes #209

@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 60649b9c-72c1-4f98-bfdb-adf223e29c91


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

- StreamingCleaner cast nullable Int*/UInt* columns to float64 before filling
  them with the running mean/median, so present values beyond 2**53 changed
  (2**53 + 1 became 2**53). Such columns now keep their integer dtype and get
  the rounded running statistic via _util.fill_na_exact; the report says so.
  Columns within +-2**53 keep the float64 behaviour.
- StreamingCleaner.clean_batch and fd.clean_timeseries raised KeyError on
  non-string column labels (e.g. 0, 7): the imputer, drift detection and the
  time-series steps indexed the frame with str(label). The str name now only
  keys the running state and report entries; frame access uses the original
  label.

Closes #208
Closes #209
@kevincostner17
kevincostner17 changed the base branch from fix/nullable-int-fill to main September 14, 2026 19:40
@github-actions

Copy link
Copy Markdown

FreshData benchmark report — performance

  • freshdata: ?
  • python: ?
  • platform: ?
fixture n_rows n_cols p50 s p95 s peak MB repair % false-repair % preserve % trust monotonic export %

Authored-code reduction (Metric 6)

@kevincostner17
kevincostner17 merged commit bdcfdf0 into main Sep 14, 2026
33 of 41 checks passed
@kevincostner17
kevincostner17 deleted the fix/streaming-labels branch September 14, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant