Skip to content

Commit

Permalink
Minor fix of doc strings/test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jmao-denver committed Jul 8, 2024
1 parent 3a0b4f4 commit f4f824c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
8 changes: 4 additions & 4 deletions py/server/deephaven/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down
11 changes: 0 additions & 11 deletions py/server/tests/test_table_iterator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#
# Copyright (c) 2016-2024 Deephaven Data Labs and Patent Pending
#
import time
import unittest
from dataclasses import dataclass

Expand Down Expand Up @@ -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))
Expand All @@ -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)

Expand All @@ -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))
Expand All @@ -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))
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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))
Expand All @@ -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)

Expand All @@ -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))
Expand All @@ -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))
Expand Down

0 comments on commit f4f824c

Please sign in to comment.