[text analytics] change return type of analyze actions to list of list#18994
Merged
kristapratico merged 5 commits intoAzure:masterfrom Jun 14, 2021
Merged
[text analytics] change return type of analyze actions to list of list#18994kristapratico merged 5 commits intoAzure:masterfrom
kristapratico merged 5 commits intoAzure:masterfrom
Conversation
kristapratico
approved these changes
Jun 1, 2021
sdk/textanalytics/azure-ai-textanalytics/tests/test_analyze_async.py
Outdated
Show resolved
Hide resolved
johanste
reviewed
Jun 1, 2021
| for doc, document_results in zip(documents, pages): | ||
| print("\nDocument text: {}".format(doc)) | ||
| recognize_entities_result = document_results[0] | ||
| assert not recognize_entities_result.is_error |
Member
There was a problem hiding this comment.
This is probably not a good use of an assert. Any document could have failed for a transient reason, so you are not really in a position to say that this didn't fail. I would print a "failed" message instead...
Member
There was a problem hiding this comment.
Actually, scratch that, this is in the readme.md. It is a bit long for the readme already. I don't think we need to show all types of actions in the readme example inline. It definitely won't scale as new action types comes along. Can we limit this to two?
…into update_analyze_output * 'master' of https://github.com/Azure/azure-sdk-for-python: (123 commits) [text analytics] Fix some issues i've found (Azure#19081) [Key Vault] Add API version 7.2 for administration (Azure#18997) hide to_analyze_request (Azure#19079) Add environment variable for redirecting IMDS token requests (Azure#18967) [translation] poller design (Azure#19041) [AutoRelease] t2-resourcemover-2021-05-21-54304(wave4) (Azure#18849) [AutoRelease] t2-logz-2021-06-02-49354 (Azure#19035) prepare pipeline (Azure#19062) [AutoRelease] t2-recoveryservicesbackup-2021-05-26-33193 (Azure#18953) Get rid of DataFeedOptions (Azure#19054) [AutoRelease] t2-batchai-2021-06-02-38609 (Azure#19036) [appconfig] new gen code (Azure#18859) [Tables] mypy (Azure#19001) fix misleading url (Azure#19044) Create py.typed (Azure#19052) add override of opentelemetry-api to 1.3.0 (Azure#19048) Prepare for June Release (Azure#19043) [Key Vault] Add API version 7.2 for keys (Azure#18586) some misc fixes. (Azure#19024) [AppConfig] pre release (Azure#19027) ...
5 tasks
johanste
approved these changes
Jun 14, 2021
iscai-msft
added a commit
that referenced
this pull request
Jun 16, 2021
…into protocol_base * 'master' of https://github.com/Azure/azure-sdk-for-python: (229 commits) Sync eng/common directory with azure-sdk-tools for PR 1688 (#19272) update all ubuntu vmImage to 20.04 (#19227) add base class for feedback (#19265) Enable tests for integration samples (#18531) docs: fix a few simple typos (#19127) Increment package version after release of azure-eventgrid (#19197) Increment package version after release of azure-monitor-query (#19208) earliest versions of communication identity tests are set up improperly. skip 1.0.0 in regression testing (#19258) Run mypy in azure-keyvault-administration CI (#19246) [text analytics] change return type of analyze actions to list of list (#18994) Increment package version after release of azure-data-tables (#19192) suppress min number less than 14 (#19230) [Key Vault] Address administration feedback (#19099) [textanalytics] remove warning tests (#19217) [translation] enable samples to run in CI (#19190) update custom_granularity_value to be more than 300 (#19215) Increment package version after release of azure-security-attestation (#19212) Enabling Before/After Test Customization for Standard CI Pipelines (#19187) bump sphinx version to resolve the weird issue with the caption not getting the correct class (#19188) [AutoRelease] t2-agrifood-2021-06-09-15946 (#19174) ...
iscai-msft
added a commit
to iscai-msft/azure-sdk-for-python
that referenced
this pull request
Jun 17, 2021
…into get_testserver_working * 'master' of https://github.com/Azure/azure-sdk-for-python: (55 commits) [AppConfig] mypy fixes (Azure#18858) [translation] renames (Azure#19285) [Key Vault] Update metadata for release (Azure#19286) [AppConfig] enable samples (Azure#18857) KeyVaultBackupOperation -> KeyVaultBackupResult (Azure#19284) renaming (Azure#19280) [Key Vault] Custom polling method for admin backup client (Azure#19204) [textanalytics] add ARM template + run samples in CI (Azure#19270) removed example from description (Azure#18781) [Key Vault] Update READMEs with RBAC information (Azure#19275) Sync eng/common directory with azure-sdk-tools for PR 1688 (Azure#19272) update all ubuntu vmImage to 20.04 (Azure#19227) add base class for feedback (Azure#19265) Enable tests for integration samples (Azure#18531) docs: fix a few simple typos (Azure#19127) Increment package version after release of azure-eventgrid (Azure#19197) Increment package version after release of azure-monitor-query (Azure#19208) earliest versions of communication identity tests are set up improperly. skip 1.0.0 in regression testing (Azure#19258) Run mypy in azure-keyvault-administration CI (Azure#19246) [text analytics] change return type of analyze actions to list of list (Azure#18994) ...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of adding a new class
AnalyzeActionsResult, we're going to reuse the current action result classes, i.e.RecognizeEntitiesResult.Now, a call with documents ["Hello", "world"] and actions [
RecognizeEntitiesAction(),AnalyzeSentimentAction()] will get you[
[
RecognizeEntitiesResultof "Hello",AnalyzeSentimentResultof "Hello"],[
RecognizeEntitiesResultof "world",AnalyzeSentimentResultof "world"],]
This is more consistent with the return types of the normal operations, and allows us to use the models we currently have