-
Notifications
You must be signed in to change notification settings - Fork 233
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
Fix trailing comma in CSV for verbose_csv and collect_metrics modes #385
Conversation
@nv-braf are there any consequences to MA from this? |
How is MA consuming these CSVs? I'm surprised it is not failing on parsing the CSVs, or getting incorrect values with columns shifted. |
This is technically changing the format of an output a user might expect to be a certain way. I'm not sure how to determine if a user is expecting the trailing comma. @dyastremsky any input? You were the one we last discussed breaking changes with and how we should be more cautious. |
I think it's unlikely someone is expecting a (unnecessary) trailing comma at the end (I don't think it's technically an invalid csv format, but it's implying there's a "null field" at the end, which we don't need to imply), so as long as MA doesn't break from this, I'm cool with getting it merged and making the output cleaner. |
I think I misunderstood what this trailing comma is. It looks like it only exists in the data rows, but not in the header row. Yeah, this is a bug (and introduced by me, my bad). Fix looks good to me--thanks Ryan. Let's just make sure MA can still work. @nv-braf suggestions on running an MA pipeline with these changes? |
For verbose only. it's true that it is just introducing an additional column that happens to be empty, so technically yes this is introducing a change to remove the empty column: $ perf_analyzer -m id --shape INPUT0:1,1 -f report_verbose.csv --verbose-csv
>>> with open("report_verbose.csv") as f:
... for line in f:
... print(len(line.split(",")))
...
17
17 However for verbose + collect-metrics, the number of columns is different in the header row and data row:
Which I believe should be considered invalid |
MA consumes the
|
Thanks for looping me in. This seems like a solid change. Seems like we're fixing previously broken behavior, which would have positive impact for customers. I assume the risk of breaking anything for customers with this change to be fairly close to zero. I do agree though that additional testing would be helpful. That would require us to explicitly decide the expected format and validate it automatically after future PRs. |
You should be able to run the MA CI with a custom version of PA. I would ask Mischa to help you with this. |
@nv-braf ran locally |
Overview
There are a few places where trailing commas are left depending on config flags:
Test/verification
Ideally there should be some unit tests to validate the produced CSVs are actually valid CSV files (no trailing delimiters), but verified locally here:
Side note, nice tool for visual verification via
jq
: