chore: Import cloudpickle Optional

This commit is contained in:
Fangyin Cheng
2024-09-06 09:00:48 +08:00
parent f8ce7d4580
commit 9042ee238d
3 changed files with 34 additions and 7 deletions

View File

@@ -36,7 +36,7 @@ def initialize_components(
system_app.register(
DefaultExecutorFactory, max_workers=param.default_thread_pool_size
)
system_app.register(DefaultScheduler)
system_app.register(DefaultScheduler, scheduler_enable=CFG.SCHEDULER_ENABLED)
system_app.register_instance(controller)
system_app.register(ConnectorManager)

View File

@@ -2,12 +2,12 @@ import inspect
from io import StringIO
from typing import Any, Dict, Optional, TextIO
import cloudpickle
def check_serializable(
obj: Any, obj_name: str = "Object", error_msg: str = "Object is not serializable"
):
import cloudpickle
try:
cloudpickle.dumps(obj)
except Exception as e:
@@ -27,6 +27,8 @@ class SerializabilityInspector:
self.stream.write(f"{indent}{message}\n")
def inspect(self, obj: Any, name: str, depth: int = 3) -> bool:
import cloudpickle
self.log(f"Inspecting '{name}'")
self.indent_level += 1