from typing import Any
from typing import Callable


def cast_field(field_value: Any, column_type: Callable) -> Any:
    """
    Returns the casted field value according to the DATATYPE_MAPPING above

    :param field_value: value of the field (Any)
    :param column_type: class constructor / function that casts the datatype to the correct type (Callable)
    :return: (Any)
    """

    if field_value is None:
        return field_value

    return column_type(field_value)