Repository navigation
FIX: validate empty cellText and cellColours in table() - #32616
klnmurthi12345 wants to merge 3 commits into
Conversation
|
Thank you for opening your first PR into Matplotlib! If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks. We also ask that you please finish addressing any review comments on this PR and wait for it to be merged (or closed) before opening a new one, as it can be a valuable learning experience to go through the review process. You can also join us on discourse chat for real-time discussion. For details on testing, writing docs, and our review process, please see the developer guide. We strive to be a welcoming and open project. Please follow our Code of Conduct. |
|
Putting review on hold until we've clarified whether this is a real issue #32614 (comment). |
|
I note that AgentScan has now upgraded its evaluation of this account to “automated”. |
PR summary
Closes #32614
When creating a table with
ax.table(cellText=[])orax.table(cellText=[[]])(orcellColours=[]),table()crashed with an unhandledIndexError: list index out of rangeorZeroDivisionError: float division by zerobecause it indexedcellText[0]and divided bycolswithout checking row and column count.This PR adds explicit checks in
table():cellText(orcellColours) haslen > 0(at least one row)len > 0(at least one column)ValueErrors:ValueError("'cellText' must contain at least one row.")ValueError("'cellText' must contain at least one column.")lib/matplotlib/tests/test_table.py.AI Disclosure
Assisted in drafting tests and verifying against test cases.
PR quality check