from typing import Callable
from typing import List
from typing import Tuple
from typing import Dict


def convert_schema(func: Callable, schema: List[Tuple[str, str]]) -> Dict[str, str]:
    """
    Convert schema in the format of {"col name": "bigint", "col2 name": "int"}
    applying some data types conversion function (e.g. spark2redshift)

    :param func: Conversion Function (e.g. spark2redshift)
    :param schema: Schema (e.g. {"col name": "bigint", "col2 name": "int"})
    :return: Converted schema
    """
    return {name: func(dtype) for name, dtype in schema}