def task_config_to_dict(task_config):
    """ Convert a task config to a dict and remove all empty keys """
    dconf = dict(task_config)
    for k in list(dconf.keys()):
        if not dconf[k]:
            del dconf[k]
    return dconf