Fix CSV reader adding empty lists in rendering summary (#3430)

* Fix CSV reader adding empty files

Fixes issue #3311

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Jason Grace 2023-11-02 11:23:30 -04:00 committed by GitHub
commit 5d73525836
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -343,6 +343,9 @@ def _log_rendering_times(*args):
print("\nRendering Summary\n-----------------\n")
# filter out empty lists caused by csv reader
data = [row for row in data if row]
max_file_length = max(len(row[0]) for row in data)
for key, group in it.groupby(data, key=lambda row: row[0]):
key = key.ljust(max_file_length + 1, ".")