def _get_names_from_list_of_dict(rows):
    """Return list of column names if ``rows`` is a list of dict that
    defines table data.

    If rows is not a list of dict then return None.
    """
    if rows is None:
        return None

    names = set()
    for row in rows:
        if not isinstance(row, dict):
            return None
        names.update(row)
    return list(names)