Skip to content

fix: warn and leave skipped parse_currency out of the report - #550

Merged
JohnnyWilson16 merged 1 commit into
mainfrom
fix/report-skipped-currency-jwd
Dec 1, 2026
Merged

JohnnyWilson16 merged 1 commit into
mainfrom
fix/report-skipped-currency-jwd

Conversation

@JohnnyWilson16

Copy link
Copy Markdown
Contributor

Stacked on #548 (it includes that CHANGELOG commit). Merge #548 first.

Cause

#538 made apply_plan skip a replayed parse_currency step when the new data has a value that is not a currency string. That keeps the data safe. But CleanReport.actions still listed parse_currency as applied, and no warning told the user the column was unchanged.

plan = fd.suggest_plan(pd.DataFrame({"amount": ["$10", "$20", "$30"]}))
out, report = fd.apply_plan(pd.DataFrame({"amount": ["$50", "REF-9921", "N/A"]}), plan, return_report=True)
# main: out unchanged, report lists parse_currency, no warning

Change

  • backends.py: new _skip_currency() helper. Both backends call it when they skip. It records the action and warns: parse_currency skipped on column 'amount': it has values that are not currency strings. The column is unchanged.
  • engine.py: the report keeps only the actions the backend did not skip.
  • CHANGELOG [Unreleased] → ### Changed (public behavior change: new UserWarning and a shorter report.actions in this case).

Check

tests/test_skipped_currency_report.py (pandas DataFrame, Polars DataFrame, Polars LazyFrame).

Before (main 15488cb):

FAILED tests/test_skipped_currency_report.py::test_skipped_parse_currency_warns_and_is_not_reported[DataFrame0]
FAILED tests/test_skipped_currency_report.py::test_skipped_parse_currency_warns_and_is_not_reported[DataFrame1]
FAILED tests/test_skipped_currency_report.py::test_skipped_parse_currency_warns_and_is_not_reported[LazyFrame]
3 failed, 3 passed in 1.14s

After:

6 passed in 0.92s

Full suite: 127 passed, 2 skipped (mkdocs-material not installed locally). ruff and mypy clean.

@coderabbitai

coderabbitai Bot commented Dec 1, 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

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9711c542-b082-4ee0-9cdd-2b05b4ece608
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

When apply_plan replays a parse_currency step on data with a value that
is not a currency string, it skips the column (#538). The CleanReport
still listed the step as applied and nothing told the user. Now both
backends warn with the column name, and the report leaves the step out.
@JohnnyWilson16
JohnnyWilson16 force-pushed the fix/report-skipped-currency-jwd branch from 88be559 to 2cde983 Compare December 1, 2026 11:04
@JohnnyWilson16
JohnnyWilson16 merged commit d2efa80 into main Dec 1, 2026
15 checks passed
@JohnnyWilson16
JohnnyWilson16 deleted the fix/report-skipped-currency-jwd branch December 1, 2026 11:10
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