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

[TA ] improve per-document error message when all documents fail per action #26902

Merged
merged 3 commits into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,8 @@

## 5.2.1 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed

### Other Changes
- Returns a more helpful message in the document error when all documents fail for an action in the `begin_analyze_actions` API.

## 5.2.0 (2022-09-08)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,8 @@ def _get_doc_results(task, doc_id_order, returned_tasks_object):
# if no results present, check for action errors
if response_task_to_deserialize.results is None:
return get_ordered_errors(returned_tasks_object, task_name, doc_id_order)
# if results obj present, but no document results (likely a canceled scenario)
if not response_task_to_deserialize.results.documents:
# if results obj present, but no document results or errors (likely a canceled scenario)
if not response_task_to_deserialize.results.documents and not response_task_to_deserialize.results.errors:
return pad_result(returned_tasks_object, doc_id_order)
return deserialization_callback(
doc_id_order, response_task_to_deserialize.results, {}, lro=True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,7 @@ def test_invalid_language_hint_method(self, client):
for document_results in response:
for doc in document_results:
assert doc.is_error
assert doc.error.code == "UnsupportedLanguageCode"

@TextAnalyticsPreparer()
@TextAnalyticsClientPreparer()
Expand Down