API difference ui.table inbetween add_rows()+remove_rows() vs update_rows() #2633
Replies: 4 comments 1 reply
-
Just understood, that the |
Beta Was this translation helpful? Give feedback.
-
Hi @bojh,
Not really. Originally I created Ultimately I think a list of rows would have been the better choice for all three methods, because it is more straightforward and less surprising. We could try to change it in version 2.0. But ideally we should auto-detect the old usage and handle it in a backward-compatible way, to avoid regression bugs in user code that are hard to spot. Something like this could work: def add_rows(self, rows: List[Dict], *args: Any) -> None:
"""Add rows to the table.
:param rows: list of rows to add
:param args: additional rows to add (DEPRECATED; for backwards compatibility only)
"""
if isinstance(rows, dict):
rows = [rows] + args
self.rows.extend(rows)
self.update() Let's convert this discussion into a feature request. |
Beta Was this translation helpful? Give feedback.
-
This feature request has been implemented in PR #3525 and will be released in version 2.0.0. |
Beta Was this translation helpful? Give feedback.
-
Oh fine, great THX, looking forward |
Beta Was this translation helpful? Give feedback.
-
Question
I just notified that there is a difference in the API for table update methods of the table:
*rows:Dict
-vs-rows: List[Dict]
-- Is there reason for?see:
Beta Was this translation helpful? Give feedback.
All reactions