def METHOD_NAME(batch_size, offset):
    return f"""
        UPDATE task_run_state
        SET result_artifact_id = (SELECT id FROM artifact WHERE task_run_state.id = task_run_state_id)
        WHERE task_run_state.id in (SELECT id FROM task_run_state WHERE (has_data IS TRUE) AND (result_artifact_id IS NULL) LIMIT {batch_size});
    """