Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Design] [FormRecognizer] Handle operation failed status consistently across Recognize and Train LROs #11473

Closed
kinelski opened this issue Apr 21, 2020 · 2 comments · Fixed by #12453
Assignees
Labels
blocking-release Blocks release Client This issue points to a problem in the data-plane of the library. Cognitive - Form Recognizer Cognitive Services
Milestone

Comments

@kinelski
Copy link
Member

kinelski commented Apr 21, 2020

Summary

When a training operation fails, no exception is thrown. The developer needs to manually check their model status and errors to assert it has succeeded before actually making use of the model.

var op = await trainingClient.StartTrainingAsync(...); // POST request succeeds
await op.WaitForCompletionAsync(); // GET request succeeds and returns a failed operation

// op.Value.Status must be checked.

Getting no exceptions could be misinterpreted as a sign that the training operation has succeeded.

However, throwing an exception in case of failure could be risky as well. It could give the developer the impression that the whole operation has failed and that no model has been created. They should be able to immediately retrieve the model id and delete it if desired. The current implementation allows that.

Goals

  • Discuss with the team what the expected behavior should be.
  • If necessary, update the client code so it can behave as expected.
  • Create tests to validate the chosen approach.
  • Make sure existing tests still pass reliably.
@kinelski kinelski added Cognitive Services Client This issue points to a problem in the data-plane of the library. FormRecognizer labels Apr 21, 2020
@kinelski kinelski added this to the [2020] June milestone Apr 21, 2020
@annelo-msft annelo-msft changed the title [FormRecognizer] Reevaluate behavior when a training operation fails [FormRecognizer] Handle operation failed status consistently across Recognize and Train LROs May 7, 2020
@annelo-msft
Copy link
Member

annelo-msft commented May 7, 2020

In addition:

@annelo-msft
Copy link
Member

@kristapratico working on this on the Python side: Azure/azure-sdk-for-python#11323

@annelo-msft annelo-msft changed the title [FormRecognizer] Handle operation failed status consistently across Recognize and Train LROs [Design] [FormRecognizer] Handle operation failed status consistently across Recognize and Train LROs May 14, 2020
@annelo-msft annelo-msft added the blocking-release Blocks release label May 18, 2020
@kinelski kinelski self-assigned this May 27, 2020
@maririos maririos assigned maririos and unassigned kinelski Jun 1, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
blocking-release Blocks release Client This issue points to a problem in the data-plane of the library. Cognitive - Form Recognizer Cognitive Services
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants