Skip to content

Commit

Permalink
REFACTOR-modin-project#7273: Remove deprecated functions from utils.p…
Browse files Browse the repository at this point in the history
…y, accessor.py and io.py

Signed-off-by: Anatoly Myachev <[email protected]>
  • Loading branch information
anmyachev committed May 15, 2024
1 parent f2dfef4 commit 2c85e5e
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 120 deletions.
23 changes: 0 additions & 23 deletions modin/pandas/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from __future__ import annotations

import pickle
import warnings
from typing import TYPE_CHECKING, Union

import pandas
Expand Down Expand Up @@ -230,28 +229,6 @@ def to_pandas(self):
"""
return self._data._to_pandas()

def to_ray_dataset(self):
"""
Convert a Modin DataFrame/Series to a Ray Dataset.
Deprecated.
Returns
-------
ray.data.Dataset
Converted object with type depending on input.
Notes
-----
Modin DataFrame/Series can only be converted to a Ray Dataset if Modin uses a Ray engine.
"""
warnings.warn(
"`DataFrame.modin.to_ray_dataset` is deprecated and will be removed in a future version. "
+ "Please use `DataFrame.modin.to_ray` instead.",
category=FutureWarning,
)
return to_ray(self._data)

def to_ray(self):
"""
Convert a Modin DataFrame/Series to a Ray Dataset.
Expand Down
57 changes: 0 additions & 57 deletions modin/pandas/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import inspect
import pathlib
import pickle
import warnings
from typing import (
IO,
TYPE_CHECKING,
Expand Down Expand Up @@ -1035,34 +1034,6 @@ def from_dataframe(df) -> DataFrame:
return ModinObjects.DataFrame(query_compiler=FactoryDispatcher.from_dataframe(df))


def from_ray_dataset(ray_obj) -> DataFrame:
"""
Convert a Ray Dataset into Modin DataFrame.
Deprecated.
Parameters
----------
ray_obj : ray.data.Dataset
The Ray Dataset to convert from.
Returns
-------
DataFrame
A new Modin DataFrame object.
Notes
-----
Ray Dataset can only be converted to Modin DataFrame if Modin uses a Ray engine.
"""
warnings.warn(
"`modin.pandas.io.from_ray_dataset` is deprecated and will be removed in a future version. "
+ "Please use `modin.pandas.io.from_ray` instead.",
category=FutureWarning,
)
from_ray(ray_obj)


def from_ray(ray_obj) -> DataFrame:
"""
Convert a Ray Dataset into Modin DataFrame.
Expand Down Expand Up @@ -1180,34 +1151,6 @@ def to_numpy(
return array


def to_ray_dataset(modin_obj):
"""
Convert a Modin DataFrame/Series to a Ray Dataset.
Deprecated.
Parameters
----------
modin_obj : modin.pandas.DataFrame, modin.pandas.Series
The DataFrame/Series to convert.
Returns
-------
ray.data.Dataset
Converted object with type depending on input.
Notes
-----
Modin DataFrame/Series can only be converted to a Ray Dataset if Modin uses a Ray engine.
"""
warnings.warn(
"`modin.pandas.io.to_ray_dataset` is deprecated and will be removed in a future version. "
+ "Please use `modin.pandas.io.to_ray` instead.",
category=FutureWarning,
)
to_ray(modin_obj)


def to_ray(modin_obj):
"""
Convert a Modin DataFrame/Series to a Ray Dataset.
Expand Down
27 changes: 1 addition & 26 deletions modin/pandas/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from pandas._typing import AggFuncType, AggFuncTypeBase, AggFuncTypeDict, IndexLabel
from pandas.util._decorators import doc

from modin.utils import func_from_deprecated_location, hashable
from modin.utils import hashable

_doc_binary_operation = """
Return {operation} of {left} and `{right}` (binary operator `{bin_op}`).
Expand All @@ -42,31 +42,6 @@
+ "https://pandas.pydata.org/pandas-docs/stable/indexing.html#attribute-access"
)

from_pandas = func_from_deprecated_location(
"from_pandas",
"modin.pandas.io",
"Importing ``from_pandas`` from ``modin.pandas.utils`` is deprecated and will be removed in a future version. "
+ "This function was moved to ``modin.pandas.io``, please import it from there instead.",
)
from_arrow = func_from_deprecated_location(
"from_arrow",
"modin.pandas.io",
"Importing ``from_arrow`` from ``modin.pandas.utils`` is deprecated and will be removed in a future version. "
+ "This function was moved to ``modin.pandas.io``, please import it from there instead.",
)
from_dataframe = func_from_deprecated_location(
"from_dataframe",
"modin.pandas.io",
"Importing ``from_dataframe`` from ``modin.pandas.utils`` is deprecated and will be removed in a future version. "
+ "This function was moved to ``modin.pandas.io``, please import it from there instead.",
)
from_non_pandas = func_from_deprecated_location(
"from_non_pandas",
"modin.pandas.io",
"Importing ``from_non_pandas`` from ``modin.pandas.utils`` is deprecated and will be removed in a future version. "
+ "This function was moved to ``modin.pandas.io``, please import it from there instead.",
)


def cast_function_modin2pandas(func):
"""
Expand Down
14 changes: 0 additions & 14 deletions modin/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,20 +546,6 @@ def deprecated_func(*args: tuple[Any], **kwargs: dict[Any, Any]) -> Any:
return deprecated_func


to_numpy = func_from_deprecated_location(
"to_numpy",
"modin.pandas.io",
"Importing ``to_numpy`` from ``modin.pandas.utils`` is deprecated and will be removed in a future version. "
+ "This function was moved to ``modin.pandas.io``, please import it from there instead.",
)
to_pandas = func_from_deprecated_location(
"to_pandas",
"modin.pandas.io",
"Importing ``to_pandas`` from ``modin.pandas.utils`` is deprecated and will be removed in a future version. "
+ "This function was moved to ``modin.pandas.io``, please import it from there instead.",
)


def hashable(obj: bool) -> bool:
"""
Return whether the `obj` is hashable.
Expand Down

0 comments on commit 2c85e5e

Please sign in to comment.