Skip to content

Commit

Permalink
Make column_to_numpy_array private
Browse files Browse the repository at this point in the history
  • Loading branch information
jmao-denver committed Mar 15, 2024
1 parent 45121bf commit 142ee80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions py/server/deephaven/numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,13 @@ def _to_column_name(name: str) -> str:
return re.sub(r"\s+", "_", tmp_name)


def column_to_numpy_array(col_def: Column, j_array: jpy.JType) -> np.ndarray:
""" Produces a numpy array from the given Java array and the Table column definition."""
def _column_to_numpy_array(col_def: Column, j_array: jpy.JType) -> np.ndarray:
""" Produces a numpy array from the given Java array and the Table column definition.
Args:
col_def:
j_array:
"""
try:
return _j_array_to_numpy_array(col_def.data_type, j_array, conv_null=False, type_promotion=False)
except DHError:
Expand All @@ -49,7 +54,7 @@ def _columns_to_2d_numpy_array(col_def: Column, j_arrays: List[jpy.JType]) -> np
else:
np_arrays = []
for j_array in j_arrays:
np_arrays.append(column_to_numpy_array(col_def=col_def, j_array=j_array))
np_arrays.append(_column_to_numpy_array(col_def=col_def, j_array=j_array))
return np.stack(np_arrays, axis=1)
except DHError:
raise
Expand Down
4 changes: 2 additions & 2 deletions py/server/deephaven/table_listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from deephaven._wrapper import JObjectWrapper
from deephaven.column import Column
from deephaven.jcompat import to_sequence
from deephaven.numpy import column_to_numpy_array
from deephaven.numpy import _column_to_numpy_array
from deephaven.table import Table
from deephaven.update_graph import UpdateGraph

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

col_dict = {}
for i, col_def in enumerate(col_defs):
np_array = column_to_numpy_array(col_def, j_array[i])
np_array = _column_to_numpy_array(col_def, j_array[i])
col_dict[col_def.name] = np_array

yield col_dict
Expand Down

0 comments on commit 142ee80

Please sign in to comment.