[Bugfix] Remove Mooncake/Yuanrong connector import warning (#1091)
Signed-off-by: natureofnature <wzliu@connect.hku.hk>
This commit is contained in:
1 parent
7bfd3c069d
commit
790e34e375
2 files changed
+12
-6
No files matched your search
@@ -15,7 +15,6 @@ except ImportError:
|
||||
try:
|
||||
from mooncake import MooncakeDistributedStore, ReplicateConfig
|
||||
except ImportError:
|
||||
logger.warning("Mooncake not available, MooncakeOmniConnector will not work")
|
||||
MooncakeDistributedStore = None
|
||||
ReplicateConfig = None
|
||||
|
||||
@@ -24,8 +23,11 @@ class MooncakeConnector(OmniConnectorBase):
|
||||
"""Mooncake-based distributed connector for OmniConnector."""
|
||||
|
||||
def __init__(self, config: dict[str, Any]):
|
||||
if MooncakeDistributedStore is None:
|
||||
raise ImportError("Mooncake not available")
|
||||
if MooncakeDistributedStore is None or ReplicateConfig is None:
|
||||
raise ImportError(
|
||||
"Mooncake components (MooncakeDistributedStore/ReplicateConfig) are not available. "
|
||||
"Please ensure the 'mooncake' package is installed in your environment."
|
||||
)
|
||||
|
||||
self.config = config
|
||||
self.host = config.get("host", "127.0.0.1")
|
||||
|
||||
@@ -11,16 +11,20 @@ logger = get_connector_logger(__name__)
|
||||
try:
|
||||
from datasystem.kv_client import KVClient, SetParam, WriteMode
|
||||
except ImportError:
|
||||
logger.warning("Datasystem not available, YuanrongConnector will not work")
|
||||
KVClient = None
|
||||
SetParam = None
|
||||
WriteMode = None
|
||||
|
||||
|
||||
class YuanrongConnector(OmniConnectorBase):
|
||||
"""Datasystem-based distributed connector for OmniConnector."""
|
||||
|
||||
def __init__(self, config: dict[str, Any]):
|
||||
if KVClient is None:
|
||||
raise ImportError("Datasystem not available")
|
||||
if KVClient is None or SetParam is None or WriteMode is None:
|
||||
raise ImportError(
|
||||
"Datasystem components (KVClient/SetParam/WriteMode) are not available. "
|
||||
"Please ensure the 'datasystem' package is installed in your environment."
|
||||
)
|
||||
|
||||
self.config = config
|
||||
self.client = None
|
||||
|
||||
Reference in new issue
Block a user