diff --git a/modin/config/envvars.py b/modin/config/envvars.py index 129ec39bc30..e3ea3d1814f 100644 --- a/modin/config/envvars.py +++ b/modin/config/envvars.py @@ -16,7 +16,7 @@ import warnings from packaging import version -from .pubsub import Parameter, _TYPE_PARAMS +from .pubsub import Parameter, _TYPE_PARAMS, ExactStr class EnvironmentVariable(Parameter, type=str, abstract=True): @@ -112,7 +112,7 @@ class IsRayCluster(EnvironmentVariable, type=bool): varname = "MODIN_RAY_CLUSTER" -class RayRedisAddress(EnvironmentVariable, type=str): +class RayRedisAddress(EnvironmentVariable, type=ExactStr): """ What Redis address to connect to when running in Ray cluster """ @@ -142,7 +142,7 @@ class Memory(EnvironmentVariable, type=int): varname = "MODIN_MEMORY" -class RayPlasmaDir(EnvironmentVariable, type=str): +class RayPlasmaDir(EnvironmentVariable, type=ExactStr): """ Path to Plasma storage for Ray """ @@ -158,7 +158,7 @@ class IsOutOfCore(EnvironmentVariable, type=bool): varname = "MODIN_OUT_OF_CORE" -class SocksProxy(EnvironmentVariable, type=str): +class SocksProxy(EnvironmentVariable, type=ExactStr): """ SOCKS proxy address if it is needed for SSH to work """ diff --git a/modin/config/pubsub.py b/modin/config/pubsub.py index 77aa1cc19b1..0196a3f7f13 100644 --- a/modin/config/pubsub.py +++ b/modin/config/pubsub.py @@ -22,11 +22,23 @@ class TypeDescriptor(typing.NamedTuple): help: str +class ExactStr(str): + """ + To be used in type params where no transformations are needed + """ + + _TYPE_PARAMS = { str: TypeDescriptor( decode=lambda value: value.strip().title(), normalize=lambda value: value.strip().title(), verify=lambda value: True, + help="a case-insensitive string", + ), + ExactStr: TypeDescriptor( + decode=lambda value: value, + normalize=lambda value: value, + verify=lambda value: True, help="a string", ), bool: TypeDescriptor(