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.
()
| 120 | |
| 121 | |
| 122 | def _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 | |
| 141 | warnings.simplefilter("once", DeprecationWarning) |
no outgoing calls
no test coverage detected