Skip to content

Commit

Permalink
[data] fix env var for enabling resource reservation (#43793)
Browse files Browse the repository at this point in the history
Fix the issue that the `RAY_DATA_ENABLE_OP_RESOURCE_RESERVATION` env var doesn't work. Because `bool("0")` returns `True`. 

---------

Signed-off-by: Hao Chen <chenh1024@gmail.com>
  • Loading branch information
raulchen authored Mar 7, 2024
1 parent 0d2cccb commit 1dd2c10
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/ray/data/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union

import ray
from ray._private.ray_constants import env_integer
from ray._private.ray_constants import env_bool, env_integer
from ray.util.annotations import DeveloperAPI
from ray.util.scheduling_strategies import SchedulingStrategyT

Expand Down Expand Up @@ -144,8 +144,8 @@
DEFAULT_ACTOR_TASK_RETRY_ON_ERRORS = False

# Whether to enable ReservationOpResourceAllocator by default.
DEFAULT_ENABLE_OP_RESOURCE_RESERVATION = bool(
os.environ.get("RAY_DATA_ENABLE_OP_RESOURCE_RESERVATION", "1")
DEFAULT_ENABLE_OP_RESOURCE_RESERVATION = env_bool(
"RAY_DATA_ENABLE_OP_RESOURCE_RESERVATION", True
)

# The default reservation ratio for ReservationOpResourceAllocator.
Expand Down

0 comments on commit 1dd2c10

Please sign in to comment.