Amazon MTurk:无法删除状态为 'Reviewable' 的 HIT

Amazon MTurk: can't delete HIT in state 'Reviewable'

我正在使用 here 提供的脚本从 Amazon Mechanical Turk 平台删除已部署的 HIT。但是,我从 mturk 客户端收到以下异常:

An error occurred (RequestError) when calling the DeleteHIT operation: This HIT is currently in the state 'Reviewable'.  This operation can be called with a status of: Reviewing, Reviewable (1574723552282 s)

对我来说,错误消息本身似乎是错误的。有人对这种行为有解释吗?

也许试试这样的方法,我在某处找到它可以解决您的问题,

# if hit is reviewable and has assignments, approve assignments
        if status == 'Reviewable':
            assignments = mturk.list_assignments_for_hit(HITId=hit['HITId'], AssignmentStatuses=['Submitted'])
            if assignments['NumResults'] > 0:
                for assign in assignments['Assignments']:
                    mturk.approve_assignment(AssignmentId=assign['AssignmentId'])

        try:
            mturk.delete_hit(HITId=hit['HITId'])
        except:
            print('Not deleted')