code: def test_extra_table_metadata() -> None:
      from superset.db_engine_specs.trino import TrinoEngineSpec
  
      db_mock = Mock()
      db_mock.get_indexes = Mock(
          return_value=[
              {"column_names": ["ds", "hour"], "name": "partition"}
          ]
      )
      db_mock.get_extra = Mock(return_value={})
      db_mock.has_view_by_name = Mock(return_value=None)
      db_mock.get_df = Mock(
          return_value=pd.DataFrame({"ds": ["01-01-19"], "hour": [1]})
      )
      result = TrinoEngineSpec.extra_table_metadata(
          db_mock, "test_table", "test_schema"
      )
      assert result["partitions"]["cols"] == ["ds", "hour"]
      assert result["partitions"]["latest"] == {
          "ds": "01-01-19",
          "hour": 1,
      }
  
imports: import copy
  import json
  from datetime import datetime
  from typing import Any, Optional
  from unittest.mock import Mock, patch
  import pandas
  import pytest
  from pytest_mock import MockerFixture
  from sqlalchemy import types
  from trino.sqlalchemy import datatype
  import superset.config
  from superset.constants import QUERY_CANCEL_KEY, QUERY_EARLY_CANCEL_KEY, USER_AGENT
  from superset.superset_typing import ResultSetColumnType, SQLAColumnType
  from superset.utils.core import GenericDataType
  from tests.unit_tests.db_engine_specs.utils import assert_column_spec, assert_convert_dttm
  from tests.unit_tests.fixtures.common import dttm
label_desc: Use image node_id 12 for calling a global function with example usage: test_extra_table_metadata() without return types