def merge_rows(list_1, list_2, key):
    """ Merges two lists of dicts based on key in dicts

    Args:
        list_1(list[dict(),]): A list of dictionaries
        list_2(list[dict(),]): A list of dictionaries
        key(string): key using which lists would be merged

    Returns:
        List of dictionaries updated after merging two lists
    """

    merged = dict()
    for row in list_1 + list_2:
        if row[key] in merged:
            merged[row[key]].update(row)
        else:
            merged[row[key]] = row
    return list(merged.values())