mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Ensure we convert str to keys for mypy in DataTable update_cell
This commit is contained in:
@@ -532,6 +532,11 @@ class DataTable(ScrollView, Generic[CellType], can_focus=True):
|
||||
CellDoesNotExist: When the supplied `row_key` and `column_key`
|
||||
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:
|
||||
self.data[row_key][column_key] = value
|
||||
except KeyError:
|
||||
|
||||
Reference in New Issue
Block a user