New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Desktop: Change 'CSV summary dive details' output from TSV to CSV. #3872
Conversation
Change the output formato for the Export / 'CSV summary dive details' from TSV to CSV, to make it consistent with the menu item name, and with the other 'CSV' export function. This was changed to TSV by @mturkia in subsurface@6c82578, but I could not find any discussion as to why. Also removed replacement of the field separator in any fields, as, according to the CSV RFC (https://datatracker.ietf.org/doc/html/rfc4180) this is not required as long as the fields containing separators are enclosed in quotes, and any quotes within the fields are doubled up. Tested with a fairly large log file, and importing into Google Sheets is working fine for the output produced. Also made capitalisation of the Export menu items consistent. Signed-off-by: Michael Keller <github@ike.ch>
We now parse CSV and not TSV files. Signed-off-by: Michael Keller <github@ike.ch>
Well - congratulations on understanding that XSLT thing. I can't. |
Thanks. 😊 |
@dirkhh Are our test cases run on pull requests nowadays? I fail to spot them from the checks list. There is a chance this change does not affect them, as it might be that the related tests are not testing against static file. But before this PR I was thinking that this was a one character change with quite a bit of tuning on our test cases. |
@mikeller My first guess is that the switch to tab separation was done before quoting the fields. Anyway, now that the fields are quoted, I do not see any reason to use tab as the separator. Did you run the testcases? I do see that you did tweak the separator there, so maybe yes. I just want to make sure the tests still pass before approving, and am not able to run the tests myself right now. |
👍 Quoting the fields (or at least the subset of fields potentially containing field separators, quotes, or line separators) and doubling all quotes inside the quoted fields is really all that is needed to generate CSV that follows the RFC and can be processed by pretty much everything that can process CSV.
I didn't initially, but then the pull request checks failed because I'd broken some tests. 😆 What I had to change was essentially switch the field separator from tab to comma when reading back the CSV output. So yes, the tests are run on pull requests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Yes they do. At least they should |
Describe the pull request:
Pull request long description:
Change the output formato for the Export / 'CSV summary dive details' from TSV to CSV, to make it consistent with the menu item name, and with the other 'CSV' export function.
This was changed to TSV by @mturkia in
6c82578, but I could not find any discussion as to why.
Also removed replacement of the field separator in any fields, as, according to the CSV RFC (https://datatracker.ietf.org/doc/html/rfc4180) this is not required as long as the fields containing separators are enclosed in quotes, and any quotes within the fields are doubled up. Tested with a fairly large log file, and importing into Google Sheets is working fine for the output produced.
Also made capitalisation of the Export menu items consistent.
Changes made:
Related issues:
https://groups.google.com/g/subsurface-divelog/c/z02NK8FjFj4
Additional information:
test_summary.csv
Release note:
export: change format produced by 'CSV summary dive details' from TSV (tab separated) to CSV
Documentation change:
Mentions: