From acf35ec311128e353f54151826d54b9ae1f877cb Mon Sep 17 00:00:00 2001 From: Joe Date: Fri, 16 Aug 2024 18:02:00 -0500 Subject: [PATCH] fix: Remove `replay_lock` in `use_table_listener` (#749) Removes `replay_lock` due to https://github.com/deephaven/deephaven-core/pull/5672 --- .../ui/src/deephaven/ui/hooks/use_table_listener.py | 7 ++----- plugins/ui/test/deephaven/ui/test_hooks.py | 11 +---------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/plugins/ui/src/deephaven/ui/hooks/use_table_listener.py b/plugins/ui/src/deephaven/ui/hooks/use_table_listener.py index 850f69c39..4d1d87027 100644 --- a/plugins/ui/src/deephaven/ui/hooks/use_table_listener.py +++ b/plugins/ui/src/deephaven/ui/hooks/use_table_listener.py @@ -70,7 +70,6 @@ def use_table_listener( dependencies: Dependencies, description: str | None = None, do_replay: bool = False, - replay_lock: LockType = "shared", ) -> None: """ Listen to a table and call a listener when the table updates. @@ -85,7 +84,6 @@ def use_table_listener( description: An optional description for the UpdatePerformanceTracker to append to the listener’s entry description, default is None. do_replay: Whether to replay the initial snapshot of the table, default is False. - replay_lock: The lock type used during replay, default is ‘shared’, can also be ‘exclusive’. """ def start_listener() -> Callable[[], None]: @@ -95,7 +93,7 @@ def start_listener() -> Callable[[], None]: Returns: A function that can be called to stop the listener by the use_effect hook. """ - if table is None or (not table.is_refreshing and not do_replay): + if table is None or not table.is_refreshing: return lambda: None handle = listen( @@ -103,12 +101,11 @@ def start_listener() -> Callable[[], None]: wrap_listener(listener), description=description, # type: ignore # missing Optional type do_replay=do_replay, - replay_lock=replay_lock, ) return lambda: handle.stop() use_effect( start_listener, - [table, listener, description, do_replay, replay_lock] + list(dependencies), + [table, listener, description, do_replay] + list(dependencies), ) diff --git a/plugins/ui/test/deephaven/ui/test_hooks.py b/plugins/ui/test/deephaven/ui/test_hooks.py index 4f325ef95..cbc3a327c 100644 --- a/plugins/ui/test/deephaven/ui/test_hooks.py +++ b/plugins/ui/test/deephaven/ui/test_hooks.py @@ -231,8 +231,7 @@ def _test_table_listener(replay_table=table, listener_val=listener): assert False, "listener was not called" def test_table_listener(self): - from deephaven import DynamicTableWriter, new_table - from deephaven.column import int_col + from deephaven import DynamicTableWriter import deephaven.dtypes as dht column_definitions = {"Numbers": dht.int32, "Words": dht.string} @@ -242,14 +241,6 @@ def test_table_listener(self): self.verify_table_updated(table_writer, table, (1, "Testing")) - static_table = new_table( - [ - int_col("Numbers", [1]), - ] - ) - - self.verify_table_replayed(static_table) - def test_table_data(self): from deephaven.ui.hooks import use_table_data from deephaven import new_table