Skip to content

Commit

Permalink
[samples][async] added some missing await methods
Browse files Browse the repository at this point in the history
  • Loading branch information
MIDDLEEAST\v-moshaban committed Mar 1, 2021
1 parent 0a37a29 commit 202e168
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async def batch_translation_async(self):

# run translation job
async with client:
job_detail = await client.create_translation_job(batch)
job_detail = await client.create_translation_job(batch) # type: JobStatusDetail

print("Job initial status: {}".format(job_detail.status))
print("Number of translations on documents: {}".format(job_detail.documents_total_count))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ async def batch_translation_with_storage_async(self):
)

with open("translated.txt", "wb") as my_blob:
download_stream = container_client.download_blob("document.txt")
download_stream = await container_client.download_blob("document.txt")
my_blob.write(await download_stream.readall())


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async def cancel_translation_job_async(self):
print("Number of translations on documents: {}".format(job_detail.documents_total_count))

await client.cancel_job(job_detail.id)
job_detail = client.get_job_status(job_detail.id) # type: JobStatusDetail
job_detail = await client.get_job_status(job_detail.id) # type: JobStatusDetail

if job_detail.status in ["Cancelled", "Cancelling"]:
print("We cancelled job with ID: {}".format(job_detail.id))
Expand Down

0 comments on commit 202e168

Please sign in to comment.