Ensure we convert str to keys for mypy in DataTable update_cell

This commit is contained in:
Darren Burns
2023-02-08 15:36:27 +00:00
parent c9398d87cf
commit 0adfda8386

View File

@@ -532,6 +532,11 @@ class DataTable(ScrollView, Generic[CellType], can_focus=True):
CellDoesNotExist: When the supplied `row_key` and `column_key` CellDoesNotExist: When the supplied `row_key` and `column_key`
cannot be found in the table. cannot be found in the table.
""" """
if isinstance(row_key, str):
row_key = RowKey(row_key)
if isinstance(column_key, str):
column_key = ColumnKey(column_key)
try: try:
self.data[row_key][column_key] = value self.data[row_key][column_key] = value
except KeyError: except KeyError: