Coverage for src / qdrant_loader / connectors / factory.py: 100%
8 statements
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-10 09:40 +0000
« prev ^ index » next coverage.py v7.13.5, created at 2026-04-10 09:40 +0000
1from typing import Any
3from .registry import CONNECTOR_REGISTRY
6def get_connector_instance(config: Any) -> Any:
7 """Create and return a connector instance based on the config's source and deployment type."""
8 key = (config.source_type, getattr(config, "deployment_type", None))
10 connector_class = CONNECTOR_REGISTRY.get(key)
12 if not connector_class:
13 raise ValueError(f"Unsupported connector type: {key}")
15 return connector_class(config)