MCPcopy
hub / github.com/feast-dev/feast / _build_client

Function _build_client

sdk/python/feast/mlflow.py:51–84  ·  view source on GitHub ↗

Create a ``FeastMlflowClient`` using the best available store.

()

Source from the content-addressed store, hash-verified

49
50
51def _build_client() -> Any:
52 """Create a ``FeastMlflowClient`` using the best available store."""
53 from feast.mlflow_integration.client import FeastMlflowClient
54
55 store = _registered_store
56 if store is None:
57 try:
58 from feast import FeatureStore
59
60 store = FeatureStore(".")
61 except Exception as exc:
62 raise RuntimeError(
63 "feast.mlflow could not auto-discover a FeatureStore. "
64 "Either call feast.mlflow.init(store), create a FeatureStore "
65 "before using feast.mlflow, or ensure feature_store.yaml "
66 "exists in the current directory."
67 ) from exc
68
69 mlflow_cfg = getattr(store.config, "mlflow", None)
70 if mlflow_cfg is None or not mlflow_cfg.enabled:
71 raise RuntimeError(
72 "MLflow integration is not enabled. "
73 "Set mlflow.enabled=true in feature_store.yaml, or call "
74 "feast.mlflow.init(store) with a store whose config has "
75 "mlflow.enabled=true."
76 )
77
78 try:
79 return FeastMlflowClient(store)
80 except ImportError:
81 raise ImportError(
82 "mlflow package is not installed. "
83 "Install it with: pip install feast[mlflow]"
84 )
85
86
87def _ensure_client() -> Any:

Callers 1

_ensure_clientFunction · 0.85

Calls 2

FeatureStoreClass · 0.90
FeastMlflowClientClass · 0.90

Tested by

no test coverage detected