diff --git a/py/server/deephaven/table.py b/py/server/deephaven/table.py index 0e11dc2900d..b3fad0f9e2f 100644 --- a/py/server/deephaven/table.py +++ b/py/server/deephaven/table.py @@ -515,7 +515,7 @@ def iter_dict(self, cols: Optional[Union[str, Sequence[str]]] = None, *, chunk_s Additionally, the generator internally maintains a fill context. The auto acquired shared lock and the fill context will be released after the generator is destroyed. That can happen implicitly when the generator is used in a for-loop. When the generator is not used in a for-loop, to prevent resource leaks, it must be closed - after use by either (1) by setting it to None, (2) using the del statement, or (3) calling the close() method on it. + after use by either (1) setting it to None, (2) using the del statement, or (3) calling the close() method on it. Args: cols (Optional[Union[str, Sequence[str]]]): The columns to read. If None, all columns are read. @@ -542,7 +542,7 @@ def iter_tuple(self, cols: Optional[Union[str, Sequence[str]]] = None, *, tuple_ Additionally, the generator internally maintains a fill context. The auto acquired shared lock and the fill context will be released after the generator is destroyed. That can happen implicitly when the generator is used in a for-loop. When the generator is not used in a for-loop, to prevent resource leaks, it must be closed - after use by either (1) by setting it to None, (2) using the del statement, or (3) calling the close() method on it. + after use by either (1) setting it to None, (2) using the del statement, or (3) calling the close() method on it. Args: cols (Optional[Union[str, Sequence[str]]]): The columns to read. If None, all columns are read. Default is None. @@ -570,7 +570,7 @@ def iter_chunk_dict(self, cols: Optional[Union[str, Sequence[str]]] = None, chun Additionally, the generator internally maintains a fill context. The auto acquired shared lock and the fill context will be released after the generator is destroyed. That can happen implicitly when the generator is used in a for-loop. When the generator is not used in a for-loop, to prevent resource leaks, it must be closed - after use by either (1) by setting it to None, (2) using the del statement, or (3) calling the close() method on it. + after use by either (1) setting it to None, (2) using the del statement, or (3) calling the close() method on it. Args: cols (Optional[Union[str, Sequence[str]]]): The columns to read. If None, all columns are read. @@ -599,7 +599,7 @@ def iter_chunk_tuple(self, cols: Optional[Union[str, Sequence[str]]] = None, tup Additionally, the generator internally maintains a fill context. The auto acquired shared lock and the fill context will be released after the generator is destroyed. That can happen implicitly when the generator is used in a for-loop. When the generator is not used in a for-loop, to prevent resource leaks, it must be closed - after use by either (1) by setting it to None, (2) using the del statement, or (3) calling the close() method on it. + after use by either (1) setting it to None, (2) using the del statement, or (3) calling the close() method on it. Args: cols (Optional[Union[str, Sequence[str]]]): The columns to read. If None, all columns are read. diff --git a/py/server/tests/test_table_iterator.py b/py/server/tests/test_table_iterator.py index e346e98c20b..026bd3f50e0 100644 --- a/py/server/tests/test_table_iterator.py +++ b/py/server/tests/test_table_iterator.py @@ -1,7 +1,6 @@ # # Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending # -import time import unittest from dataclasses import dataclass @@ -42,7 +41,6 @@ def test_iteration_in_chunks(self): self.assertIn(col.name, d) self.assertEqual(d[col.name].dtype, col.data_type.np_type) self.assertLessEqual(len(d[col.name]), 100) - time.sleep(0.1) total_read_size += len(d[col.name]) self.assertEqual(total_read_size, test_table.size) self.assertFalse(ug.has_shared_lock(test_table)) @@ -59,7 +57,6 @@ def test_iteration_in_chunks(self): for col in cols: self.assertIn(col, d) self.assertLessEqual(len(d[col]), 100) - time.sleep(0.1) total_read_size += len(d[col]) self.assertEqual(total_read_size, test_table.size) @@ -86,7 +83,6 @@ def test_iteration_in_rows(self): v_type = type(d[col.name]) self.assertTrue(np.can_cast(col.data_type.np_type, np.dtype(v_type)) or self.assertEqual(v_type, col.data_type.j_type)) - time.sleep(0.001) total_read_size += 1 self.assertEqual(total_read_size, test_table.size) self.assertFalse(ug.has_shared_lock(test_table)) @@ -102,7 +98,6 @@ def test_iteration_in_rows(self): self.assertEqual(len(d), len(cols)) for col in cols: self.assertIn(col, d) - time.sleep(0.1) total_read_size += 1 self.assertEqual(total_read_size, test_table.size) self.assertTrue(ug.has_shared_lock(test_table)) @@ -135,7 +130,6 @@ def test_direct_call_chunks(self): for col in cols: self.assertIn(col, d) total_read_size += len(d[col]) - time.sleep(0.001) except StopIteration: break # the table can't refresh with the lock, so the total read size must be the same as the table size @@ -187,7 +181,6 @@ def test_direct_call_rows(self): for col in cols: self.assertIn(col, d) total_read_size += 1 - time.sleep(0.001) except StopIteration: break # the table can't refresh with the lock, so the total read size must be the same as the table size @@ -284,7 +277,6 @@ def test_iteration_in_chunks_tuple(self): self.assertEqual(col.name, d._fields[i]) self.assertEqual(d[i].dtype, col.data_type.np_type) self.assertLessEqual(len(d[i]), 100) - time.sleep(0.1) total_read_size += len(d[i]) self.assertEqual(total_read_size, test_table.size) self.assertFalse(ug.has_shared_lock(test_table)) @@ -301,7 +293,6 @@ def test_iteration_in_chunks_tuple(self): for i, col in enumerate(cols): self.assertEqual(col, d._fields[i]) self.assertLessEqual(len(d[i]), 100) - time.sleep(0.1) total_read_size += len(d[i]) self.assertEqual(total_read_size, test_table.size) @@ -328,7 +319,6 @@ def test_iteration_in_rows_tuple(self): v_type = type(d[i]) self.assertTrue(np.can_cast(col.data_type.np_type, np.dtype(v_type)) or self.assertEqual(v_type, col.data_type.j_type)) - time.sleep(0.001) total_read_size += 1 self.assertEqual(total_read_size, test_table.size) self.assertFalse(ug.has_shared_lock(test_table)) @@ -344,7 +334,6 @@ def test_iteration_in_rows_tuple(self): self.assertEqual(len(d), len(cols)) for i, col in enumerate(cols): self.assertEqual(col, d._fields[i]) - time.sleep(0.1) total_read_size += 1 self.assertEqual(total_read_size, test_table.size) self.assertTrue(ug.has_shared_lock(test_table))