Skip to content

Commit 699da68

Browse files
committed
updating add_table to handle widget not being ready when get_overlays called
1 parent 92ddef7 commit 699da68

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

src/ipyaladin/widget.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,16 @@ def add_table(
880880
{"event_name": "add_table", "options": table_options},
881881
buffers=[table_bytes.getvalue()],
882882
)
883-
self.get_overlays()
883+
if not self._ready:
884+
warnings.warn(
885+
"The table has not yet finished loading into the widget, so the "
886+
"overlays list has not been updated. Please call `get_overlays()` "
887+
"to update the list.",
888+
UserWarning,
889+
stacklevel=2,
890+
)
891+
else:
892+
self.get_overlays()
884893

885894
@widget_should_be_loaded
886895
def add_graphic_overlay_from_region(

0 commit comments

Comments
 (0)