Skip to content

Commit

Permalink
feat: Support remove_blink to remove blink table semantics in serve…
Browse files Browse the repository at this point in the history
…r-side Python (deephaven#5958)

`removeBlink` is used by the Java API to disable the specialized
aggregation semantics that blink tables implement. This wrapper adds the
functionality to disable those semantics from the Python API.
  • Loading branch information
alexpeters1208 committed Sep 4, 2024
1 parent a457ff9 commit ea0dcb2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions py/server/deephaven/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,10 @@ def flatten(self) -> Table:
"""Returns a new version of this table with a flat row set, i.e. from 0 to number of rows - 1."""
return Table(j_table=self.j_table.flatten())

def remove_blink(self) -> Table:
"""Returns a non-blink child table, or this table if it is not a blink table."""
return Table(j_table=self.j_table.removeBlink())

def snapshot(self) -> Table:
"""Returns a static snapshot table.
Expand Down
6 changes: 6 additions & 0 deletions py/server/tests/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,12 @@ def test_attributes(self):
self.assertEqual(len(attrs), len(rt_attrs) + 1)
self.assertIn("BlinkTable", set(attrs.keys()) - set(rt_attrs.keys()))

def test_remove_blink(self):
t_blink = time_table("PT1s", blink_table=True)
t_no_blink = t_blink.remove_blink()
self.assertEqual(t_blink.is_blink, True)
self.assertEqual(t_no_blink.is_blink, False)

def test_grouped_column_as_arg(self):
t1 = empty_table(100).update(
["id = i % 10", "Person = random() > 0.5 ? true : random() > 0.5 ? false : true"]).sort(
Expand Down

0 comments on commit ea0dcb2

Please sign in to comment.