diff --git a/fiftyone/operators/types.py b/fiftyone/operators/types.py index d76221f664..55a12caa79 100644 --- a/fiftyone/operators/types.py +++ b/fiftyone/operators/types.py @@ -1848,17 +1848,18 @@ class Tooltip(View): column: the column of the tooltip """ - def __init__(self, row, column, **kwargs): + def __init__(self, row, column, value, **kwargs): super().__init__(**kwargs) self.row = row self.column = column + self.value = value def clone(self): - clone = Tooltip(self.row, self.column, **self._kwargs) + clone = Tooltip(self.row, self.column, self.value, **self._kwargs) return clone def to_json(self): - return {**super().to_json(), "row": self.row, "column": self.column} + return {**super().to_json(), "row": self.row, "column": self.column, "value": self.value} class TableView(View): diff --git a/tests/unittests/operators/tableview_tests.py b/tests/unittests/operators/tableview_tests.py index 49cfbcff25..6ac8149fd6 100644 --- a/tests/unittests/operators/tableview_tests.py +++ b/tests/unittests/operators/tableview_tests.py @@ -46,4 +46,5 @@ def test_table_view_basic(self): table.add_tooltip(1, 1, "Tooltip 3", overwrite=False) table.add_tooltip(1, 1, "Tooltip 3") + self.assertEqual(set([tooltip.value for tooltip in table.tooltips]), {"Tooltip 2", "Tooltip 3"})