Skip to content

test(ingestion): assert the fixed Excel behaviour, not the defect - #485

Open
kevincostner17 wants to merge 1 commit into
mainfrom
fix/ingestion-tests-after-excel-fix
Open

kevincostner17 wants to merge 1 commit into
mainfrom
fix/ingestion-tests-after-excel-fix

Conversation

@kevincostner17

Copy link
Copy Markdown
Contributor

main is red — this fixes it

main at c0fbb08: 7064 passed, 2 failed.

FAILED tests/test_ingestion_roundtrip.py::test_excel_ingestion_drops_leading_zeros_that_the_csv_path_preserves
FAILED tests/test_ingestion_roundtrip.py::test_csv_to_excel_round_trip_loses_the_leading_zeros_csv_had_kept

Why

#478 found that preserve_leading_zeros was a no-op for clean_excel and — following the repo's convention of not using xfail — pinned the defect as it behaved:

assert list(fd.clean_excel(xlsx)["zip"]) == [2134, 501, 10001]  # DEFECT

#480 then fixed that defect.

Each PR was green on its own branch, and each was rebased on a main that did not contain the other, so nothing caught the pair until both had landed. Those two assertions were tripwires for the fix, and the fix duly tripped them.

The change

Both assertions now describe the repaired behaviour, and each docstring keeps the history so the tests still explain why they exist.

The round-trip case gains nothing artificial — it simply asserts that the Excel hop no longer undoes a correct CSV clean, which is the property that was missing in the first place. The opt-out (preserve_leading_zeros=False) and explicit-dtype paths are asserted alongside, so the fix cannot drift into applying unconditionally.

Verification

  • tests/test_ingestion_roundtrip.py: 22 passed.
  • Full suite py3.12: 7066 passed, 27 skipped, 0 failed, coverage 94.21%.
  • ruff check . clean repo-wide.
  • No library code changed.

Process note

A green CI check on each PR independently is not evidence that main will be green after both land. When a test pins a defect as current behaviour, it is a merge-order dependency — the second of the pair needs a rebase onto the first and a re-run before merging.

main went red at c0fbb08: 7064 passed, 2 failed.

#478 found that preserve_leading_zeros was a no-op for clean_excel and, following
the repo's convention of not using xfail, pinned the defect as it behaved:

    assert list(fd.clean_excel(xlsx)["zip"]) == [2134, 501, 10001]  # DEFECT

#480 then fixed that defect. Each PR was green on its own branch, and each was
rebased on a main that did not contain the other, so nothing caught the pair
until both had landed. The two assertions were tripwires for the fix, and the
fix duly tripped them.

Both now assert the repaired behaviour, and each docstring keeps the history so
the tests still explain why they exist. The round-trip case gains nothing
artificial -- it simply asserts that the Excel hop no longer undoes a correct
CSV clean, which is the property that was missing in the first place. The
opt-out and explicit-dtype paths are asserted alongside, so the fix cannot drift
into applying unconditionally.

Full suite 7066 passed / 0 failed, coverage 94.21%; ruff clean repo-wide.
@coderabbitai

coderabbitai Bot commented Sep 17, 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: 3b42bb79-2724-4fa4-9b80-d5a7c70fc780


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.

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