[translation] account for nonstandard LRO status strings
See original GitHub issueThe service will return “Cancelled” (with two "l"s), “Cancelling”, and “ValidationFailed”.
Here are the status strings that azure-core polling currently checks to see if the operation has reached a terminal state: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/core/azure-core/azure/core/polling/base_polling.py#L52-L54
We need to check for these nonstandard statuses or the LRO will run forever.
Options:
- Simply map the nonstandard statuses to those of the ones checked in the
get_statusmethod:
if status:
if status == "ValidationFailed":
return "Failed"
elif status in ["Cancelled", "Cancelling"]:
return "Canceled"
return status
else:
raise BadResponse("No status found in body")
- Define a custom polling method that will inherit from LROBasePolling and override the methods checking for a terminal state like here in Text Analytics: https://github.com/Azure/azure-sdk-for-python/blob/master/sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_lro.py#L32
I favor option 1, but we might need to re-evaluate if it makes sense with the current error states of the service. E.g. if we map “ValidationFailed” to a status == “Failed”, now we will throw an exception instead of just returning the JobStatusDetail when wait_until_done is called by the user.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Supported file formats — Weblate 4.15.1 documentation
For correct use of monolingual files, Weblate requires access to a file containing complete list of strings to translate with their source—this file...
Read more >Best Practices for XML Internationalization - W3C
Abstract. This document provides a set of guidelines for developing XML documents and schemas that are internationalized properly.
Read more >Exclude Content from Translation and Restore Excluded Strings
Excluded strings will appear untranslated in your translated file or webpage - it will not be removed. Excluded strings can be found in...
Read more >Translate's Localization Guide
The translation status page keeps up to date statistics on the progress of each language, your language should appear.
Read more >Binarized Forest to String Translation - Google Research
Tree-to-string translation is syntax-aware and efficient but sensitive to parsing errors. Forest- to-string translation approaches mitigate the risk of ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Tentative plan (may/may not make it for beta.1). If it does not make it in time then fallback plan will be to always return
JobStatusDetail.This is the expected behavior when calling
wait_until_doneclosed with #17738