from typing import Dict


def serialize_result_row(row, table) -> Dict:
    """
    Takes a sqlalchemy result object and maps it into a dict
    using column names
    """

    return dict((col, getattr(row, col)) for col in table.c.keys() if hasattr(row, col))