code: def test_dataset_macro_mutator_with_comments(
      mocker: MockFixture,
  ) -> None:
      """
      Test ``dataset_macro`` when the mutator adds comment.
      """
  
      def mutator(sql: str) -> str:
          """
          A simple mutator that wraps the query in comments.
          """
          return f"-- begin\n{sql}\n-- end"
  
      DatasetDAO = mocker.patch("superset.daos.dataset.DatasetDAO")
      DatasetDAO.find_by_id().get_query_str_extended().sql = mutator(
          "SELECT 1"
      )
      assert (
          dataset_macro(1)
          == """(
  -- begin
  SELECT 1
  -- end
  ) AS dataset_1"""
      )
  
file_path: superset/tests/unit_tests/jinja_context_test.py
imports: import json
  import pytest
  from pytest_mock import MockFixture
  from sqlalchemy.dialects import mysql
  from superset.commands.dataset.exceptions import DatasetNotFoundError
  from superset.jinja_context import dataset_macro, WhereInMacro
label_desc: Use image node_id 3 for calling a global function with example usage: test_dataset_macro_mutator_with_comments(mocker) and returns: str, sql, str