Repository navigation
Update Ray to the latest version #3318
Copy link
Copy link
Closed
Labels
good first issueGood for newcomersGood for newcomers
Description
Feature Request / Improvement
It seems that the updates of Ray fail because we set None to the working directory in the test fixtures: #3313
==================================== ERRORS ====================================
_____________ ERROR at setup of test_ray_nan[session_catalog_hive] _____________
@pytest.fixture(scope="session")
def ray_session() -> Generator[Any, None, None]:
"""Fixture to manage Ray initialization and shutdown for tests."""
import ray
> ray.init(
ignore_reinit_error=True,
runtime_env={"working_dir": None}, # Prevent Ray from serializing the working directory to workers
)
tests/conftest.py:3037:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.venv/lib/python3.12/site-packages/ray/_private/client_mode_hook.py:107: in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.12/site-packages/ray/_private/worker.py:1798: in init
runtime_env = _maybe_modify_runtime_env(runtime_env, _skip_env_hook)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.venv/lib/python3.12/site-packages/ray/_private/worker.py:1396: in _maybe_modify_runtime_env
return hook(runtime_env)
^^^^^^^^^^^^^^^^^
.venv/lib/python3.12/site-packages/ray/_private/runtime_env/uv_runtime_env_hook.py:411: in hook
if _is_path(working_dir):
^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
path_or_uri = None
def _is_path(path_or_uri: str) -> bool:
"""Returns True if uri_or_path is a path and False otherwise.
IMPORTANT: This is a duplicate of ray._private.path_utils.is_path().
Why we can't import from path_utils:
- This hook runs via `uv run --no-project uv_runtime_env_hook.py` in test scenarios
- UV creates a minimal environment without dependencies installed yet
- Importing from ray._private.path_utils triggers the full Ray import chain:
ray._private.path_utils → ray/__init__.py → ray._private.worker →
ray.widgets → ray.widgets.util → packaging.version
- The 'packaging' module is not available in the minimal UV environment,
causing: ModuleNotFoundError: No module named 'packaging.version'
This duplicate implementation uses only stdlib (pathlib, urllib.parse)
to avoid the dependency issue. If you modify this function, ensure you
also update ray._private.path_utils.is_path() to keep them in sync.
"""
if not isinstance(path_or_uri, str):
> raise TypeError(f"path_or_uri must be a string, got {type(path_or_uri)}.")
E TypeError: path_or_uri must be a string, got <class 'NoneType'>.
I think it would be better to set it to a temporary directory, like /tmp/ on unix based filesystems. We can leverage tmp_path here: https://docs.pytest.org/en/stable/how-to/tmp_path.html
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers
Activity
tanmayrauth commentedon May 3, 2026
@Fokko I would like to work on this issue
ArchitAgarwal04 commentedon May 3, 2026
@Fokko if this is not assigned to anyone , I would Like to work on it. Could you please assign it to me
kevinjqliu commentedon May 3, 2026
fixed by https://github.com/apache/iceberg-python/pull/3299/files#diff-e52e4ddd58b7ef887ab03c04116e676f6280b824ab7469d5d3080e5cba4f2128R3032-R3038