mirror of
https://github.com/apache/superset.git
synced 2026-05-22 00:05:15 +00:00
The `tool/__init__.py` re-exports the `get_chart_data` function from its submodule of the same name, which shadows the module binding in the `tool` package namespace. mock.patch walks the dotted string by getattr()-ing the package namespace, so `superset.mcp_service.chart.tool.get_chart_data.event_logger` resolves `get_chart_data` to the function, then raises AttributeError on `event_logger`, then falls back to `__import__` and fails with ModuleNotFoundError. Obtain the actual module via importlib and patch.object the attribute directly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>