bito-code-review[bot] commented on code in PR #43176:
URL: https://github.com/apache/superset/pull/43176#discussion_r4174223630
##########
tests/unit_tests/mcp_service/chart/test_preview_utils.py:
##########
@@ -398,3 +398,80 @@ def test_vega_preview_y_axis_fallback_accepts_decimal() ->
None:
)
assert encoding["y"]["field"] == "revenue"
+
+
+def test_generate_preview_from_form_data_exposes_jinja_context(
+ monkeypatch: pytest.MonkeyPatch,
+) -> None:
+ """Unsaved-chart previews expose the same Jinja inputs as execution."""
+ from types import SimpleNamespace
+ from typing import Any
+ from unittest.mock import MagicMock
Review Comment:
<!-- Bito Reply -->
The redundant local import of `MagicMock` has been removed, and the
module-level import is now correctly utilized. This change is appropriate and
improves the code by eliminating unnecessary shadowing and binding.
**tests/unit_tests/mcp_service/chart/test_preview_utils.py**
```
def test_generate_preview_from_form_data_exposes_jinja_context(
monkeypatch: pytest.MonkeyPatch,
) -> None:
"""Unsaved-chart previews expose the same Jinja inputs as execution."""
from types import SimpleNamespace
from typing import Any
```
--
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]