[Tech Debt] Use f-string for python/ray/*.py (#10268)

* In progress.

* Done with critical path.

* Modified cluster_utils.py and log_monitor.py

* Addressed code review.
This commit is contained in:
SangBin Cho
2020-08-23 22:01:31 -07:00
committed by GitHub
parent b61a79efd7
commit 1f54acd274
11 changed files with 89 additions and 90 deletions
+8 -7
View File
@@ -100,9 +100,10 @@ class RayTaskError(RayError):
in_worker = False
for line in lines:
if line.startswith("Traceback "):
out.append("{}{}{} (pid={}, ip={})".format(
colorama.Fore.CYAN, self.proctitle, colorama.Fore.RESET,
self.pid, self.ip))
out.append(f"{colorama.Fore.CYAN}"
f"{self.proctitle}"
f"{colorama.Fore.RESET} "
f"(pid={self.pid}, ip={self.ip})")
elif in_worker:
in_worker = False
elif "ray/worker.py" in line or "ray/function_manager.py" in line:
@@ -178,13 +179,13 @@ class UnreconstructableError(RayError):
def __str__(self):
return (
"Object {} is lost (either LRU evicted or deleted by user) and "
f"Object {self.object_ref.hex()} is lost "
"(either LRU evicted or deleted by user) and "
"cannot be reconstructed. Try increasing the object store "
"memory available with ray.init(object_store_memory=<bytes>) "
"or setting object store limits with "
"ray.remote(object_store_memory=<bytes>). See also: {}".format(
self.object_ref.hex(),
"https://docs.ray.io/en/latest/memory-management.html"))
"ray.remote(object_store_memory=<bytes>). "
"See also: https://docs.ray.io/en/latest/memory-management.html")
class RayTimeoutError(RayError):