Conversation
|
Thanks for working on this @Sidu9! The duplicate header issue when appending is definitely real. However, removing Could we update this to:
|
A-S-Manoj
left a comment
There was a problem hiding this comment.
LGTM. Tested locally, ran the append logic across multiple writes to the same file, and confirmed the header appears only once with no duplication. Output parses cleanly with csv.DictReader.
A regression test asserting the header shows up only once across repeated writes would be a nice add-on, but it's not blocking.
Approving.
|
@kaifcodec Ah, missed your comment above, after checking, I agree with you. My approval was based on testing the CLI append path, which does work, but you're right that hardcoding into_csv() to drop the header breaks the documented library usage. +1 on the include_header param approach. |
|
Yeah no worries @A-S-Manoj, it happens. |
|
Addressed your review @kaifcodec and added regression tests covering all the scenarios @A-S-Manoj. Let me know if this is Okay. Do we also need to make any changes to the docs to incorporate this new param? |
|
Nice work @Sidu9, this addresses the concern. |
|
I've updated the documentation @A-S-Manoj. Let me know if its ok |
Description
Fixes an issue where the CSV header was duplicated every time results were appended to an existing output file.
Previously, the CSV formatter always included the header, causing repeated headers when the CLI was run multiple times against the same output file.
Changes
Testing
Closes #648