Commit ddb2e9a
fix: Avoid importing feast.feature_store at mcp_server import time
mcp_server used a module-level `from feast.feature_store import FeatureStore`
solely for a type annotation on add_mcp_support_to_app. Because the
feast.infra.mcp_servers package __init__ eagerly imports mcp_server, importing
the package pulled in the entire feature_store import graph. Under parallel
unit-test collection (pytest -n) this intermittently raced with an in-progress
feature_store import and failed collection of test_mcp_server.py with
`KeyError: 'feast.infra.mcp_servers.mcp_server'`.
Move the import under TYPE_CHECKING and use a forward reference, so importing
mcp_server no longer triggers the feature_store graph. Public API and the
annotation are unchanged.
Signed-off-by: Larry Singleton <166439969+larrysingleton007@users.noreply.github.com>1 parent 7ae64ec commit ddb2e9a
1 file changed
Lines changed: 6 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
97 | 98 | | |
98 | 99 | | |
99 | 100 | | |
100 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
101 | 104 | | |
102 | 105 | | |
103 | 106 | | |
| |||
0 commit comments