from typing import Dict
from typing import Any


def build_data_columns(hparams: Dict[str, Any]) -> Dict[str, Any]:
    """Build data columns from hyper-parameters.

    Args:
        hparams: hyper-parameters for the data columns.

    Returns:
        data columns.
    """
    try:
        input_columns = hparams["input"]
    except KeyError:
        input_columns = None
    try:
        target_columns = hparams["target"]
    except KeyError:
        target_columns = None
    # create dictionary
    if input_columns:
        data_columns = {"input": input_columns, "target": target_columns}
    else:
        data_columns = {"target": target_columns}
    return data_columns