from typing import Sequence
from typing import Tuple


def get_ddl_schema(fields: Sequence[Tuple[str, str]]) -> str:
    """Get the ddl style schema from (name, dtype) fields.

    Parameters
    ----------
    dtypes : sequence of tuple
        List of (name, dtype) tuples, similar to the output of
        pyspark.sql.DataFrame.dtypes.

    Returns
    -------
    str
        The ddl schema.
    """
    ddl_schema = '\n'.join([f'{name} {dtype},' for name, dtype in fields])
    # Remove the last comma.
    return ddl_schema[:-1]