Skip to content

fix kfintech conflict resolver dropping group columns#8

Merged
sandeeprjs92 merged 1 commit intomainfrom
fix/kfintech-conflict-drops-columns
Apr 14, 2026
Merged

fix kfintech conflict resolver dropping group columns#8
sandeeprjs92 merged 1 commit intomainfrom
fix/kfintech-conflict-drops-columns

Conversation

@sandeeprjs92
Copy link
Copy Markdown
Contributor

resolve_kfintech_conflicts used groupby.apply(include_groups=False) to silence a pandas 2.2 FutureWarning. That flag also strips the group columns (transaction_number, folio_number) from the apply result, so the downstream composite-key builder crashed with KeyError: 'transaction_number' on any KFintech file that reached this step — tools/end_to_end_demo.py hit it on kfintech_sample.csv.

Rewrite as a manual row-index scan: loop over groups, collect indices of rows to keep, return df.loc[kept]. Keeps every column, no deprecated API, same semantics.

Regression test in test_cleaner.py runs a minimal KFintech DataFrame through Cleaner.run and asserts that transaction_number, folio_number, and composite_key all survive.

Verified end-to-end locally: 96 unit tests pass, tools/end_to_end_demo.py produces 49 transactions across all three sample files (CAMS CSV, KFintech CSV, KFintech DBF).

resolve_kfintech_conflicts used groupby.apply with include_groups=False
to silence a pandas 2.2 FutureWarning. That flag strips the group
columns (transaction_number, folio_number) from the apply result, so
the downstream composite_key builder crashed with KeyError on any
KFintech file that reached this step.

Rewrite as a manual row-index scan: loop over groups, collect indices
of rows to keep, return df.loc[kept]. Keeps every column, no
deprecated api, same semantics. Regression test in test_cleaner.py
runs a minimal KFintech df through Cleaner.run and asserts the
expected columns survive.
@sandeeprjs92 sandeeprjs92 merged commit 564fbfd into main Apr 14, 2026
8 checks passed
@sandeeprjs92 sandeeprjs92 deleted the fix/kfintech-conflict-drops-columns branch April 14, 2026 06:33
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