aminghadersohi opened a new pull request, #37023:
URL: https://github.com/apache/superset/pull/37023

   ## Summary
   
   Fixes MCP service startup failures caused by circular import issues and 
deprecation warnings.
   
   **Root cause**: `get_schema.py` imported DAOs at module level, triggering 
SQLAlchemy model loading which requires Flask app initialization (for encrypted 
fields). This caused the import chain to crash before Flask was ready.
   
   ## Changes
   
   - Move DAO imports from module-level to inside factory functions in 
`get_schema.py` (lazy imports)
   - Add `initialize_core_mcp_dependencies()` call before tool/prompt imports 
in `app.py` to fix `@prompt` decorator `NotImplementedError`
   - Move `stateless_http=True` from `create_mcp_app()` constructor to `run()` 
calls in `__main__.py` and `server.py` to fix FastMCP deprecation warning
   - Add unit tests verifying initialization order and lazy import patterns
   
   ## Test plan
   
   - [x] All 27 MCP unit tests pass
   - [x] Pre-commit hooks pass
   - [x] Manually tested all MCP tools via connected client
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to