Files
superset2/tests
Mehmet Salih Yavuz 3e2e3da56e fix(mcp): patch event_logger via the module object, not a dotted string
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>
2026-04-20 13:34:21 +03:00
..