Skip to content

Commit 1c8c11f

Browse files
authored
Make column_to_numpy_array private (#5256)
* Make column_to_numpy_array private * Respond to review comments
1 parent 45325e8 commit 1c8c11f

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

py/server/deephaven/numpy.py

+14-3
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,19 @@ def _to_column_name(name: str) -> str:
2727
return re.sub(r"\s+", "_", tmp_name)
2828

2929

30-
def column_to_numpy_array(col_def: Column, j_array: jpy.JType) -> np.ndarray:
31-
""" Produces a numpy array from the given Java array and the Table column definition."""
30+
def _column_to_numpy_array(col_def: Column, j_array: jpy.JType) -> np.ndarray:
31+
""" Produces a numpy array from the given Java array and the Table column definition.
32+
33+
Args:
34+
col_def (Column): the column definition
35+
j_array (jpy.JType): the Java array
36+
37+
Returns:
38+
np.ndarray
39+
40+
Raises:
41+
DHError
42+
"""
3243
try:
3344
return _j_array_to_numpy_array(col_def.data_type, j_array, conv_null=False, type_promotion=False)
3445
except DHError:
@@ -49,7 +60,7 @@ def _columns_to_2d_numpy_array(col_def: Column, j_arrays: List[jpy.JType]) -> np
4960
else:
5061
np_arrays = []
5162
for j_array in j_arrays:
52-
np_arrays.append(column_to_numpy_array(col_def=col_def, j_array=j_array))
63+
np_arrays.append(_column_to_numpy_array(col_def=col_def, j_array=j_array))
5364
return np.stack(np_arrays, axis=1)
5465
except DHError:
5566
raise

py/server/deephaven/table_listener.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from deephaven._wrapper import JObjectWrapper
1717
from deephaven.column import Column
1818
from deephaven.jcompat import to_sequence
19-
from deephaven.numpy import column_to_numpy_array
19+
from deephaven.numpy import _column_to_numpy_array
2020
from deephaven.table import Table
2121
from deephaven.update_graph import UpdateGraph
2222

@@ -51,7 +51,7 @@ def _changes_to_numpy(table: Table, cols: Union[str, List[str]], row_set, chunk_
5151

5252
col_dict = {}
5353
for i, col_def in enumerate(col_defs):
54-
np_array = column_to_numpy_array(col_def, j_array[i])
54+
np_array = _column_to_numpy_array(col_def, j_array[i])
5555
col_dict[col_def.name] = np_array
5656

5757
yield col_dict

0 commit comments

Comments
 (0)