Skip to content

Commit 1029762

Browse files
Damian-Nordicpull[bot]
authored andcommitted
[tools] Try to fix bloat check when comment has empty cell (#26479)
The bloat check has been failing for months now because gh_report.py script seems to assume that the first row in a comment to the analyzed PR has no empty cells, and for the cc32xx platform, which happens to finish the build as the first one, a row with a blank section name is added. I don't know what is the reason of the blank section, but the script should not give up just because of one invalid entry as we miss important code size increase warnings. Also, replace deprecated DataFrame.append with concat().
1 parent f63e90a commit 1029762

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

scripts/tools/memory/gh_report.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,8 @@ def merge(df: pd.DataFrame, comment) -> pd.DataFrame:
375375
cols, rows = memdf.util.markdown.read_hierified(body)
376376
break
377377
logging.debug('REC: read %d rows', len(rows))
378-
df = df.append(pd.DataFrame(data=rows, columns=cols).astype(df.dtypes))
378+
df = pd.concat([df, pd.DataFrame(data=rows, columns=cols).astype(df.dtypes)],
379+
ignore_index=True)
379380
return df.sort_values(
380381
by=['platform', 'target', 'config', 'section']).drop_duplicates()
381382

scripts/tools/memory/memdf/util/markdown.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def read_hierified(f):
3434
for i in range(0, len(header)):
3535
column = columns[i + 1].strip()
3636
if not column:
37-
column = rows[-1][i]
37+
column = rows[-1][i] if rows else '(blank)'
3838
row.append(column)
3939
rows.append(tuple(row))
4040

0 commit comments

Comments
 (0)