mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
[datasets] Add an env var for progress bar behavior (#20586)
Adds a RAY_DATA_DISABLE_PROGRESS_BARS env var to control the default progress bar behavior. The default value is "0". Setting it to "1" disables progress bars, unless they are reenabled again by the set_progress_bars method.
This commit is contained in:
parent
1a00964902
commit
c385756817
1 changed files with 7 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
from typing import List, Any
|
||||
|
||||
import ray
|
||||
from ray.ray_constants import env_integer
|
||||
from ray.types import ObjectRef
|
||||
from ray.util.annotations import PublicAPI
|
||||
|
||||
|
@ -12,13 +13,18 @@ except ImportError:
|
|||
needs_warning = True
|
||||
|
||||
# Whether progress bars are enabled in this process.
|
||||
_enabled: bool = True
|
||||
_enabled: bool = not bool(env_integer("RAY_DATA_DISABLE_PROGRESS_BARS", 0))
|
||||
|
||||
|
||||
@PublicAPI
|
||||
def set_progress_bars(enabled: bool) -> bool:
|
||||
"""Set whether progress bars are enabled.
|
||||
|
||||
The default behavior is controlled by the
|
||||
``RAY_DATA_DISABLE_PROGRESS_BARS`` environment variable. By default,
|
||||
it is set to "0". Setting it to "1" will disable progress bars, unless
|
||||
they are reenabled by this method.
|
||||
|
||||
Returns:
|
||||
Whether progress bars were previously enabled.
|
||||
"""
|
||||
|
|
Loading…
Add table
Reference in a new issue