def remove_empty_keys(dirty_dict):
    """
    Remove empty keys from a dictionary. This method is useful when passing jsons
    in which a null field will update the value to null and you don't want that.
    """

    clean_dict = {}

    for k, v in dirty_dict.items():
        if v:
            clean_dict[k] = v

    return clean_dict