output: to_csv: print header for every set of parsed fields#453
Merged
rmilecki merged 1 commit intoinvoice-x:masterfrom Feb 3, 2023
Merged
output: to_csv: print header for every set of parsed fields#453rmilecki merged 1 commit intoinvoice-x:masterfrom
rmilecki merged 1 commit intoinvoice-x:masterfrom
Conversation
Collaborator
rmilecki
commented
Jan 22, 2023
Collaborator
Author
|
This also fixes #297 |
Collaborator
Author
|
Ping @bosd :) |
bosd
approved these changes
Feb 3, 2023
Collaborator
bosd
left a comment
There was a problem hiding this comment.
I'm neutral on this. (Don't use csv output) Code LGTM
Collaborator
Author
|
Me neither, I don't think CSV is a good fit for tree structures anyway. I just wanted to fix that issue and noticed an extra problem with doing so. Thank you for looking at this pull request! |
When parsing multiple invoices it's *incorrect* to: 1. Display header with fields names of the *first* parsed invoice 2. Display content of *all* parsed invoices It's because parsing dfferent invoices may result in different fields. In such case header won't make sense for all rows. To improve handling such situations display new header for every set of fields that differs from the last one. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
8ff5d5b to
4de4445
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.