Skip to content

add tests for append_to_last_row - #3855

Merged
tomaarsen merged 3 commits into
huggingface:mainfrom
RavSinghChandan:tests-append-to-last-row
Jul 13, 2026
Merged

add tests for append_to_last_row#3855
tomaarsen merged 3 commits into
huggingface:mainfrom
RavSinghChandan:tests-append-to-last-row

Conversation

@RavSinghChandan

Copy link
Copy Markdown
Contributor

append_to_last_row in util/misc.py didn't have any tests, so added a few to tests/util/test_misc.py.

it's used to tack extra columns onto the last row of a results csv, and the behaviour that's easy to break in a refactor is the guard: it only writes when there's a header plus at least one data row, otherwise it no-ops and returns False. so the tests cover:

  • appending one value to the last data row
  • appending multiple values
  • header-only file -> returns False, file untouched
  • empty file -> returns False, file untouched

ruff check + format are clean.

@tomaarsen

Copy link
Copy Markdown
Member

Hello!

I think this is pretty low priority, but it doesn't really hurt. I merged the tests into one parametrize, as they were all very very similar.

  • Tom Aarsen

@tomaarsen
tomaarsen merged commit d1ebac5 into huggingface:main Jul 13, 2026
16 of 17 checks passed
@tomaarsen

Copy link
Copy Markdown
Member

The test failures seem to be related to torch 2.13 + Windows + BF16 on CPU. I suspect they're missing/not importing a required CPU instruction. I'll leave it be for now.

  • Tom Aarsen

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.

2 participants