Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support remove_blink to remove blink table semantics in server-side Python #5958

Merged
merged 4 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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