question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[translation] account for nonstandard LRO status strings

See original GitHub issue

The 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:

  1. Simply map the nonstandard statuses to those of the ones checked in the get_status method:
            if status:
                if status == "ValidationFailed":
                    return "Failed"
                elif status in ["Cancelled", "Cancelling"]:
                    return "Canceled"
                return status
            else:
                raise BadResponse("No status found in body")
  1. 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:closed
  • Created 3 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
kristapraticocommented, Mar 16, 2021

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_done

Service terminal state status Job level error? Document level error? SDK behavior
ValidationFailed Yes No, returns 0 documents in list Throw exception with job level error details
Failed No Yes, per document Return JobStatusDetail, user can inquire on each document for error
Succeeded / (maybe partiallySucceeded) No No Return JobStatusDetail
Cancelled/Cancelling No No Return JobStatusDetail
0reactions
kristapraticocommented, Apr 1, 2021

closed with #17738

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found