| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
⚠️ Please install the Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## master #6634 +/- ##
==========================================
- Coverage 45.75% 45.75% -0.01%
==========================================
Files 414 414
Lines 49701 49700 -1
Branches 7087 7087
==========================================
- Hits 22739 22738 -1
Misses 25377 25377
Partials 1585 1585
Continue to review full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Sorry, something went wrong.
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>
| Back | FazBrowse Home | New Git URL |
What this PR does / why we need it:
feast/infra/mcp_servers/mcp_server.py imported feast.feature_store.FeatureStore at module load, but used it only 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 the entire feature_store import graph in as a side effect.
Under parallel unit-test collection (pytest -n), that heavy import intermittently raced with an in-progress feature_store import and failed collection of tests/unit/infra/feature_servers/test_mcp_server.py with KeyError: 'feast.infra.mcp_servers.mcp_server'. The tests pass in isolation, so it shows up as a flaky unit-test-python failure.
Moving the import under TYPE_CHECKING with a forward-reference annotation removes feature_store from mcp_server's module-load path, so importing mcp_server no longer triggers that graph. Public API and the annotation are unchanged.
Which issue(s) this PR fixes:
Fixes #6633
Checks
Testing Strategy
test_mcp_server.py passes (23), and feast.infra.mcp_servers still exposes add_mcp_support_to_app and McpFeatureServerConfig. ruff and mypy clean.
Misc
Release note: NONE.
As an outside contributor I can't apply labels, so a maintainer will need to add kind/bug and run ok-to-test.