Skip to content

Commit

Permalink
FIX-#7234: Deprecate HDK engine (#7235)
Browse files Browse the repository at this point in the history
Signed-off-by: Igoshev, Iaroslav <iaroslav.igoshev@intel.com>
  • Loading branch information
YarShev committed May 2, 2024
1 parent 2afcfe0 commit 3bdbbcb
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
20 changes: 20 additions & 0 deletions modin/config/envvars.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,26 @@ def _get_default(cls) -> str:
"Please refer to installation documentation page to install an engine"
)

@classmethod
def get(cls) -> str:
"""
Get value of the Engine.
Returns
-------
str
"""
value = super().get()
if value == "Native":
from modin.error_message import ErrorMessage

ErrorMessage.single_warning(
"HDK engine is deprecated and will be removed in a future version. "
+ "Consider switching to Ray, Dask or MPI engine.",
FutureWarning,
)
return value

@classmethod
@doc(Parameter.add_option.__doc__)
def add_option(cls, choice: Any) -> Any:
Expand Down
10 changes: 7 additions & 3 deletions modin/error_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# governing permissions and limitations under the License.

import warnings
from typing import NoReturn, Set
from typing import NoReturn, Optional, Set

from modin.logging import get_logger
from modin.utils import get_current_execution
Expand All @@ -36,7 +36,11 @@ def not_implemented(cls, message: str = "") -> NoReturn:
)

@classmethod
def single_warning(cls, message: str) -> None:
def single_warning(
cls, message: str, category: Optional[type[Warning]] = None
) -> None:
# note that there should not be identical messages with different categories since
# only the message is used as the hash key.
message_hash = hash(message)
logger = get_logger()
if message_hash in cls.printed_warnings:
Expand All @@ -46,7 +50,7 @@ def single_warning(cls, message: str) -> None:
return

logger.debug(f"Modin Warning: Single Warning: {message} was raised.")
warnings.warn(message)
warnings.warn(message, category=category)
cls.printed_warnings.add(message_hash)

@classmethod
Expand Down

0 comments on commit 3bdbbcb

Please sign in to comment.