Skip to content
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

DataTable.add_row gives misleading error with too many arguments. #4722

Closed
merriam opened this issue Jul 11, 2024 · 2 comments
Closed

DataTable.add_row gives misleading error with too many arguments. #4722

merriam opened this issue Jul 11, 2024 · 2 comments

Comments

@merriam
Copy link
Contributor

merriam commented Jul 11, 2024

Create a DataTable with one column. Do a table.add_row("A", "B").
Get AttributeError: 'NoneType' object has no attribute 'key', which is an odd error.
Instead I should get ValueError: Too many column values provided to add_row

Caused by widgets/_data_table.py:1583, for column, cell in zip_longest(self.ordered_columns, cells)

Will put in a PR that checks the length and puts an error message that doesn't have me pull hair out for ten minutes.

@Textualize Textualize deleted a comment from github-actions bot Jul 11, 2024
@darrenburns
Copy link
Member

Good catch.

Copy link

Don't forget to star the repository!

Follow @textualizeio for Textual updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants