Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions awswrangler/_distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,14 @@
from importlib import reload
from typing import Any, Callable, Dict, Literal, Optional, TypeVar, cast

WR_ENGINE = os.getenv("WR_ENGINE")
WR_MEMORY_FORMAT = os.getenv("WR_MEMORY_FORMAT")
EngineLiteral = Literal["python", "ray"]
MemoryFormatLiteral = Literal["pandas", "modin"]

FunctionType = TypeVar("FunctionType", bound=Callable[..., Any])


WR_ENGINE: Optional[EngineLiteral] = os.getenv("WR_ENGINE") # type: ignore[assignment]
WR_MEMORY_FORMAT: Optional[MemoryFormatLiteral] = os.getenv("WR_MEMORY_FORMAT") # type: ignore[assignment]


@unique
Expand All @@ -31,11 +37,6 @@ class MemoryFormatEnum(Enum):
PANDAS = "pandas"


EngineLiteral = Literal["python", "ray"]
MemoryFormatLiteral = Literal["pandas", "modin"]
FunctionType = TypeVar("FunctionType", bound=Callable[..., Any])


class Engine:
"""Execution engine configuration class."""

Expand Down Expand Up @@ -111,7 +112,7 @@ def wrapper(*args: Any, **kw: Dict[str, Any]) -> Any:
def register(cls, name: Optional[EngineLiteral] = None) -> None:
"""Register the distribution engine dispatch methods."""
with cls._lock:
engine_name = cast(EngineLiteral, name or cls.get_installed().value)
engine_name = cast(EngineLiteral, name or cls.get().value)
cls.set(engine_name)
cls._registry.clear()

Expand Down