Skip to content

Commit

Permalink
FIX-modin-project#5730 Allow modin objects to be passed into modin.nu…
Browse files Browse the repository at this point in the history
…mpy.array constructor directly

Signed-off-by: Rehan Durrani <rehan@ponder.io>
  • Loading branch information
RehanSD committed Mar 2, 2023
1 parent e2a03ad commit 5db6ca8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modin/numpy/arr.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ def __init__(
ErrorMessage.single_warning(
"Using Modin's new NumPy API. To convert from a Modin object to a NumPy array, either turn off the ExperimentalNumPyAPI flag, or use `modin.utils.to_numpy`."
)
if isinstance(object, pd.DataFrame):
_query_compiler = object._query_compiler
_ndim = 2
elif isinstance(object, pd.Series):
_query_compiler = object._query_compiler
_ndim = 1
if _query_compiler is not None:
self._query_compiler = _query_compiler
self._ndim = _ndim
Expand Down

0 comments on commit 5db6ca8

Please sign in to comment.