code: def test_python_date_format_by_column_name(
      mocker: MockerFixture,
      test_table: "SqlaTable",
  ) -> None:
      """
      Test the ``SQLA_TABLE_MUTATOR`` setting for "python_date_format".
      """
      table_defaults = {
          "dttm_columns": {
              "id": {"python_date_format": "epoch_ms"},
              "dttm": {"python_date_format": "epoch_s"},
              "duration_ms": {"python_date_format": "invalid"},
          },
      }
      mocker.patch(
          "superset.connectors.sqla.models.config",
          new={
              "SQLA_TABLE_MUTATOR": partial(
                  apply_dttm_defaults,
                  dttm_defaults=table_defaults,
              )
          },
      )
      mocker.patch(
          "superset.connectors.sqla.models.get_physical_table_metadata",
          return_value=[
              {
                  "column_name": "id",
                  "type": "INTEGER",
                  "is_dttm": False,
              },
              {
                  "column_name": "dttm",
                  "type": "INTEGER",
                  "is_dttm": False,
              },
              {
                  "column_name": "duration_ms",
                  "type": "INTEGER",
                  "is_dttm": False,
              },
          ],
      )
  
      test_table.fetch_metadata()
  
      id_col = [c for c in test_table.columns if c.column_name == "id"][
          0
      ]
      assert id_col.is_dttm
      assert id_col.python_date_format == "epoch_ms"
  
      dttm_col = [
          c for c in test_table.columns if c.column_name == "dttm"
      ][0]
      assert dttm_col.is_dttm
      assert dttm_col.python_date_format == "epoch_s"
  
      duration_ms_col = [
          c
          for c in test_table.columns
          if c.column_name == "duration_ms"
      ][0]
      assert duration_ms_col.is_dttm
      assert duration_ms_col.python_date_format == "invalid"
  
file_path: superset/tests/unit_tests/config_test.py
imports: from functools import partial
  from typing import Any, TYPE_CHECKING
  import pytest
  from pytest_mock import MockerFixture
  from sqlalchemy.orm.session import Session
label_desc: Use image node_id 6 for calling a global function with example usage: test_python_date_format_by_column_name(mocker, test_table) without return types