Repository: modin-project/modin

Issue:
Problem with using MODIN_ON_RAY_PLASMA_DIR environment variable
### System information
- **OS Platform and Distribution (e.g., Linux Ubuntu 16.04)**: Linux Ubuntu 18.04
- **Modin version** (`modin.__version__`): f7f1f7ac553dc3cc6595204fb7566db0e8f7f85f
- **Python version**: 3.8.6
- **Code we can use to reproduce**:
```
export MODIN_ON_RAY_PLASMA_DIR=/some/path/tmp
python -c "import modin.pandas as pd"
```

<!--
You can obtain the Modin version with

python -c "import modin; print(modin.__version__)"
-->

### Describe the problem
<!-- Describe the problem clearly here. -->

### Source code / logs
<!-- Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached. Try to provide a reproducible test case that is the bare minimum necessary to generate the problem. -->
```
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/modin/modin/pandas/__init__.py", line 178, in <module>
    Engine.subscribe(_update_engine)
  File "/modin/modin/config/pubsub.py", line 95, in subscribe
    callback(cls)
  File "/modin/modin/pandas/__init__.py", line 119, in _update_engine
    initialize_ray()
  File "/modin/modin/engines/ray/utils.py", line 139, in initialize_ray
    ray.init(
  File "/miniconda3/envs/modin_new/lib/python3.8/site-packages/ray/worker.py", line 713, in init
    _global_node = ray.node.Node(
  File "/miniconda3/envs/modin_new/lib/python3.8/site-packages/ray/node.py", line 207, in __init__
    self.start_ray_processes()
  File "/miniconda3/envs/modin_new/lib/python3.8/site-packages/ray/node.py", line 825, in start_ray_processes
    ray._private.services.determine_plasma_store_config(
  File "/miniconda3/envs/modin_new/lib/python3.8/site-packages/ray/_private/services.py", line 1575, in determine_plasma_store_config
    raise ValueError(f"The file {plasma_directory} does not "
ValueError: The file /Some/Path/Tmp does not exist or is not a directory.
```



Discussion:
This is caused by my https://github.com/modin-project/modin/pull/2189, so I'm taking this issue.

Resolving patch:
diff --git a/modin/config/envvars.py b/modin/config/envvars.py
--- 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
--- 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(


Test patch:
diff --git a/modin/config/test/test_envvars.py b/modin/config/test/test_envvars.py
--- a/modin/config/test/test_envvars.py
+++ b/modin/config/test/test_envvars.py
@@ -14,7 +14,7 @@
 import os
 import pytest
 
-from modin.config.envvars import EnvironmentVariable, _check_vars
+from modin.config.envvars import EnvironmentVariable, _check_vars, ExactStr
 
 
 @pytest.fixture
@@ -25,9 +25,9 @@ def make_unknown_env():
     del os.environ[varname]
 
 
-@pytest.fixture
-def make_custom_envvar():
-    class CustomVar(EnvironmentVariable, type=str):
+@pytest.fixture(params=[str, ExactStr])
+def make_custom_envvar(request):
+    class CustomVar(EnvironmentVariable, type=request.param):
         """ custom var """
 
         default = 10
@@ -40,7 +40,7 @@ class CustomVar(EnvironmentVariable, type=str):
 @pytest.fixture
 def set_custom_envvar(make_custom_envvar):
     os.environ[make_custom_envvar.varname] = "  custom  "
-    yield "Custom"
+    yield "Custom" if make_custom_envvar.type is str else "  custom  "
     del os.environ[make_custom_envvar.varname]