Skip to content

Commit 0f386a9

Browse files
committed
Fix input table jpy restriction
1 parent d9d4189 commit 0f386a9

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

py/server/deephaven/table_factory.py

-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ class InputTable(Table):
235235
236236
Users should always create InputTables through factory methods rather than directly from the constructor.
237237
"""
238-
j_object_type = _JBaseArrayBackedInputTable
239238

240239
def __init__(self, j_table: jpy.JType):
241240
super().__init__(j_table)

py/server/tests/test_table_factory.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
from deephaven.column import byte_col, char_col, short_col, bool_col, int_col, long_col, float_col, double_col, \
1414
string_col, datetime_col, pyobj_col, jobj_col
1515
from deephaven.constants import NULL_DOUBLE, NULL_FLOAT, NULL_LONG, NULL_INT, NULL_SHORT, NULL_BYTE
16-
from deephaven.table_factory import DynamicTableWriter, ring_table
16+
from deephaven.table_factory import DynamicTableWriter, InputTable, ring_table
1717
from tests.testbase import BaseTestCase
1818
from deephaven.table import Table
1919
from deephaven.stream import blink_to_append_only, stream_to_append_only
2020

2121
JArrayList = jpy.get_type("java.util.ArrayList")
2222
_JBlinkTableTools = jpy.get_type("io.deephaven.engine.table.impl.BlinkTableTools")
2323
_JDateTimeUtils = jpy.get_type("io.deephaven.time.DateTimeUtils")
24+
_JTable = jpy.get_type("io.deephaven.engine.table.Table")
2425

2526

2627
@dataclass
@@ -372,6 +373,11 @@ def test_input_table(self):
372373
keyed_input_table.delete(t.select(["String", "Double"]))
373374
self.assertEqual(keyed_input_table.size, 0)
374375

376+
with self.subTest("custom input table creation"):
377+
place_holder_input_table = empty_table(1).update_view(["Key=`A`", "Value=10"]).with_attributes({_JTable.INPUT_TABLE_ATTRIBUTE: "Placeholder IT"}).j_table
378+
# Confirming no error.
379+
InputTable(place_holder_input_table)
380+
375381
def test_ring_table(self):
376382
cols = [
377383
bool_col(name="Boolean", data=[True, False]),

0 commit comments

Comments
 (0)