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 Actions docs and throw when more than one action type #22333

Merged
merged 1 commit into from
Jun 30, 2021

Conversation

maririos
Copy link
Member

  • Improve docstrings for AnalyzeActions functionality
  • Throw if more than one action type is set
  • Tests for ^

@@ -3,11 +3,15 @@
## 5.1.0-beta.8 (Unreleased)
### New features
- Added support for service version `3.0`. This can be specified in the `TextAnalyticsClientOptions` object under the `ServiceVersion` enum. By default the SDK targets latest supported service version.
- Added AAD support for the `StartAnalyzeHealthcareEntities` methods.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to add in previous PR

@@ -2408,39 +2396,43 @@ public virtual async Task<AnalyzeActionsOperation> StartAnalyzeActionsAsync(IEnu

private AnalyzeActionsOperation StartAnalyzeActions(MultiLanguageBatchInput batchInput, TextAnalyticsActions actions, AnalyzeActionsOptions options = default, CancellationToken cancellationToken = default)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The diff looks all weird. what I did was:

  • Create method ValidateActions that throws if more than one action type is set
  • Aggregated all transforms from actions to tasks into a method called CreateTasks that can be used by both StartAnalyzeActions and StartAnalyzeActionsAsync methods

@@ -358,7 +358,6 @@ public void AnalyzeOperationWithErrorTest()
{
ExtractKeyPhrasesActions = new List<ExtractKeyPhrasesAction>()
{
new ExtractKeyPhrasesAction(),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to remove dup action type as it is no longer supported. The purpose of the tests still maintains which is to validate that we get an error when setting an invalid version.
It required re-record

@maririos maririos merged commit 6ad3a9a into Azure:main Jun 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants