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

Function _get_track_materialization

sdk/python/feast/feature_store.py:122–138  ·  view source on GitHub ↗

Lazy-import feast.metrics only when materialization tracking is needed. Avoids importing the metrics module (and its prometheus_client / psutil dependencies plus temp-dir creation) for every FeatureStore usage such as ``feast apply`` or simple SDK reads.

()

Source from the content-addressed store, hash-verified

120
121
122def _get_track_materialization():
123 """Lazy-import feast.metrics only when materialization tracking is needed.
124
125 Avoids importing the metrics module (and its prometheus_client /
126 psutil dependencies plus temp-dir creation) for every FeatureStore
127 usage such as ``feast apply`` or simple SDK reads.
128 """
129 global _track_materialization, _track_materialization_loaded
130 if not _track_materialization_loaded:
131 _track_materialization_loaded = True
132 try:
133 from feast.metrics import track_materialization
134
135 _track_materialization = track_materialization
136 except Exception: # pragma: no cover
137 _track_materialization = None
138 return _track_materialization
139
140
141warnings.simplefilter("once", DeprecationWarning)

Callers 2

materializeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected