Skip to content

Commit

Permalink
[tools] Try to fix bloat check when comment has empty cell (#26479)
Browse files Browse the repository at this point in the history
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().
  • Loading branch information
Damian-Nordic authored and pull[bot] committed Nov 8, 2023
1 parent 28e23a5 commit 8c99c51
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion scripts/tools/memory/gh_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ def merge(df: pd.DataFrame, comment) -> pd.DataFrame:
cols, rows = memdf.util.markdown.read_hierified(body)
break
logging.debug('REC: read %d rows', len(rows))
df = df.append(pd.DataFrame(data=rows, columns=cols).astype(df.dtypes))
df = pd.concat([df, pd.DataFrame(data=rows, columns=cols).astype(df.dtypes)],
ignore_index=True)
return df.sort_values(
by=['platform', 'target', 'config', 'section']).drop_duplicates()

Expand Down
2 changes: 1 addition & 1 deletion scripts/tools/memory/memdf/util/markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def read_hierified(f):
for i in range(0, len(header)):
column = columns[i + 1].strip()
if not column:
column = rows[-1][i]
column = rows[-1][i] if rows else '(blank)'
row.append(column)
rows.append(tuple(row))

Expand Down

0 comments on commit 8c99c51

Please sign in to comment.