1111from importlib import reload
1212from typing import Any , Callable , Dict , Literal , Optional , TypeVar , cast
1313
14- WR_ENGINE = os .getenv ("WR_ENGINE" )
15- WR_MEMORY_FORMAT = os .getenv ("WR_MEMORY_FORMAT" )
14+ EngineLiteral = Literal ["python" , "ray" ]
15+ MemoryFormatLiteral = Literal ["pandas" , "modin" ]
16+
17+ FunctionType = TypeVar ("FunctionType" , bound = Callable [..., Any ])
18+
19+
20+ WR_ENGINE : Optional [EngineLiteral ] = os .getenv ("WR_ENGINE" ) # type: ignore[assignment]
21+ WR_MEMORY_FORMAT : Optional [MemoryFormatLiteral ] = os .getenv ("WR_MEMORY_FORMAT" ) # type: ignore[assignment]
1622
1723
1824@unique
@@ -31,11 +37,6 @@ class MemoryFormatEnum(Enum):
3137 PANDAS = "pandas"
3238
3339
34- EngineLiteral = Literal ["python" , "ray" ]
35- MemoryFormatLiteral = Literal ["pandas" , "modin" ]
36- FunctionType = TypeVar ("FunctionType" , bound = Callable [..., Any ])
37-
38-
3940class Engine :
4041 """Execution engine configuration class."""
4142
@@ -111,7 +112,7 @@ def wrapper(*args: Any, **kw: Dict[str, Any]) -> Any:
111112 def register (cls , name : Optional [EngineLiteral ] = None ) -> None :
112113 """Register the distribution engine dispatch methods."""
113114 with cls ._lock :
114- engine_name = cast (EngineLiteral , name or cls .get_installed ().value )
115+ engine_name = cast (EngineLiteral , name or cls .get ().value )
115116 cls .set (engine_name )
116117 cls ._registry .clear ()
117118
0 commit comments