Can I stop an ongoing AWS transcription job with Boto3?

150 Views Asked by At

I am currently working with AWS Transcribe in Python to transcribe files longer than 4 hours. I split these files into chunks and process them individually. However, if one chunk fails, I'd like to stop the transcription jobs for the other chunks immediately. I found the following function in the boto3 library: client.delete_transcription_job(TranscriptionJobName='job') According to the official documentation, it's not clear if this function can be used to stop an ongoing transcription job.

Can anyone with experience using AWS Transcribe confirm if this function can be used to stop an ongoing transcription job? I haven't tested it yet to avoid unnecessary costs.

If this function can indeed stop ongoing jobs, will I be billed only for the partial usage of the stopped jobs, or will I be billed for the entire duration? It could save up to $5.76 per stopped segment if so.

Any help or guidance would be much appreciated.

1

There are 1 best solutions below

0
Pizza Programmer On

I ended up trying it, the answer is no. An image of the pending job. When you call to delete it you get this error: botocore.errorfactory.BadRequestException: An error occurred (BadRequestException) when calling the DeleteTranscriptionJob operation: The job couldn't be deleted. Make sure it exists and isn't pending.

I thought this meant it was queued and hadn't started, but I made sure the script ran several seconds after it was in progress, and it gave the same error. Once it completed, I ran it again, and it deleted without any issues.

def delete(job):
    transcribe = boto3.client(
        'transcribe',
        region_name="us-east-1"
    )
    transcribe.delete_transcription_job(TranscriptionJobName=self.job)