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

[text analytics] Fix some issues i've found #19081

Merged
merged 7 commits into from
Jun 3, 2021
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
3 changes: 3 additions & 0 deletions sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
- Renamed `AnalyzeBatchActionsType` to `AnalyzeActionsType`.
- Renamed `AnalyzeBatchActionsResult` to `AnalyzeActionsResult`.
- Renamed `AnalyzeBatchActionsError` to `AnalyzeActionsError`.
- Renamed `AnalyzeHealthcareEntitiesResultItem` to `AnalyzeHealthcareEntitiesResult`.
- Fixed `AnalyzeHealthcareEntitiesResult`'s `statistics` to be the correct type, `TextDocumentStatistics`
- Remove `RequestStatistics`, use `TextDocumentBatchStatistics` instead

**New Features**
- Added enums `EntityConditionality`, `EntityCertainty`, and `EntityAssociation`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,14 @@
RecognizePiiEntitiesResult,
PiiEntity,
PiiEntityDomainType,
AnalyzeHealthcareEntitiesResultItem,
AnalyzeHealthcareEntitiesResult,
HealthcareEntity,
HealthcareEntityDataSource,
RecognizeEntitiesAction,
RecognizeLinkedEntitiesAction,
RecognizePiiEntitiesAction,
ExtractKeyPhrasesAction,
AnalyzeActionsResult,
RequestStatistics,
AnalyzeActionsType,
AnalyzeActionsError,
HealthcareEntityRelationRoleType,
Expand All @@ -49,14 +48,14 @@
HealthcareEntityAssertion,
AnalyzeSentimentAction
)
from ._paging import AnalyzeHealthcareEntitiesResult
from ._generated.v3_1_preview_5.models import (
PiiCategory as PiiEntityCategoryType,
RelationType as HealthcareEntityRelationType,
Conditionality as EntityConditionality,
Certainty as EntityCertainty,
Association as EntityAssociation
)
from ._lro import AnalyzeHealthcareEntitiesLROPoller, AnalyzeActionsLROPoller

__all__ = [
'TextAnalyticsApiVersion',
Expand Down Expand Up @@ -85,7 +84,6 @@
'RecognizePiiEntitiesResult',
'PiiEntity',
'PiiEntityDomainType',
'AnalyzeHealthcareEntitiesResultItem',
'AnalyzeHealthcareEntitiesResult',
'HealthcareEntity',
'HealthcareEntityDataSource',
Expand All @@ -94,7 +92,6 @@
'RecognizePiiEntitiesAction',
'ExtractKeyPhrasesAction',
'AnalyzeActionsResult',
'RequestStatistics',
'AnalyzeActionsType',
"AnalyzeActionsError",
"PiiEntityCategoryType",
Expand All @@ -106,7 +103,9 @@
"EntityConditionality",
"EntityCertainty",
"EntityAssociation",
"AnalyzeSentimentAction"
"AnalyzeSentimentAction",
"AnalyzeHealthcareEntitiesLROPoller",
"AnalyzeActionsLROPoller",
]

__version__ = VERSION

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import warnings

# FIXME: have to manually reconfigure import path for multiapi operation mixin
from .._lro import AnalyzeBatchActionsLROPoller, AnalyzeBatchActionsLROPollingMethod, AnalyzeHealthcareEntitiesLROPoller, AnalyzeHealthcareEntitiesLROPollingMethod
from .._lro import AnalyzeActionsLROPoller, AnalyzeActionsLROPollingMethod, AnalyzeHealthcareEntitiesLROPoller, AnalyzeHealthcareEntitiesLROPollingMethod
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
Expand Down Expand Up @@ -84,12 +84,12 @@ def begin_analyze(
:type body: ~azure.ai.textanalytics.v3_1_preview_5.models.AnalyzeBatchInput
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AnalyzeBatchActionsLROPollingMethod.
:keyword polling: By default, your polling method will be AnalyzeActionsLROPollingMethod.
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.PollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AnalyzeBatchActionsLROPoller that returns either AnalyzeJobState or the result of cls(response)
:rtype: ~...._lro.AnalyzeBatchActionsLROPoller[~azure.ai.textanalytics.v3_1_preview_5.models.AnalyzeJobState]
:return: An instance of AnalyzeActionsLROPoller that returns either AnalyzeJobState or the result of cls(response)
:rtype: ~...._lro.AnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_1_preview_5.models.AnalyzeJobState]
:raises ~azure.core.exceptions.HttpResponseError:
"""
api_version = self._get_api_version('begin_analyze')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import warnings

# FIXME: have to manually reconfigure import path for multiapi operation mixin
from ..._async_lro import AnalyzeHealthcareEntitiesAsyncLROPoller, AnalyzeHealthcareEntitiesAsyncLROPollingMethod, AsyncAnalyzeBatchActionsLROPoller, AsyncAnalyzeBatchActionsLROPollingMethod
from ...aio._lro_async import AsyncAnalyzeHealthcareEntitiesLROPoller, AsyncAnalyzeHealthcareEntitiesLROPollingMethod, AsyncAnalyzeActionsLROPoller, AsyncAnalyzeActionsLROPollingMethod
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
Expand Down Expand Up @@ -70,7 +70,7 @@ async def begin_analyze(
self,
body: Optional["_models.AnalyzeBatchInput"] = None,
**kwargs
) -> AsyncAnalyzeBatchActionsLROPoller["_models.AnalyzeJobState"]:
) -> AsyncAnalyzeActionsLROPoller["_models.AnalyzeJobState"]:
"""Submit analysis job.

Submit a collection of text documents for analysis. Specify one or more unique tasks to be
Expand All @@ -80,12 +80,12 @@ async def begin_analyze(
:type body: ~azure.ai.textanalytics.v3_1_preview_5.models.AnalyzeBatchInput
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AsyncAnalyzeBatchActionsLROPollingMethod.
:keyword polling: By default, your polling method will be AsyncAnalyzeActionsLROPollingMethod.
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncAnalyzeBatchActionsLROPoller that returns either AnalyzeJobState or the result of cls(response)
:rtype: ~....._async_lro.AsyncAnalyzeBatchActionsLROPoller[~azure.ai.textanalytics.v3_1_preview_5.models.AnalyzeJobState]
:return: An instance of AsyncAnalyzeActionsLROPoller that returns either AnalyzeJobState or the result of cls(response)
:rtype: ~....._async_lro.AsyncAnalyzeActionsLROPoller[~azure.ai.textanalytics.v3_1_preview_5.models.AnalyzeJobState]
:raises ~azure.core.exceptions.HttpResponseError:
"""
api_version = self._get_api_version('begin_analyze')
Expand Down Expand Up @@ -142,7 +142,7 @@ async def begin_health(
string_index_type: Optional[Union[str, "_models.StringIndexType"]] = None,
logging_opt_out: Optional[bool] = None,
**kwargs
) -> AnalyzeHealthcareEntitiesAsyncLROPoller["_models.HealthcareJobState"]:
) -> AsyncAnalyzeHealthcareEntitiesLROPoller["_models.HealthcareJobState"]:
"""Submit healthcare analysis job.

Start a healthcare analysis job to recognize healthcare related entities (drugs, conditions,
Expand All @@ -167,12 +167,12 @@ async def begin_health(
:type logging_opt_out: bool
:keyword callable cls: A custom type or function that will be passed the direct response
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
:keyword polling: By default, your polling method will be AnalyzeHealthcareEntitiesAsyncLROPollingMethod.
:keyword polling: By default, your polling method will be AsyncAnalyzeHealthcareEntitiesLROPollingMethod.
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AnalyzeHealthcareEntitiesAsyncLROPoller that returns either HealthcareJobState or the result of cls(response)
:rtype: ~....._async_lro.AnalyzeHealthcareEntitiesAsyncLROPoller[~azure.ai.textanalytics.v3_1_preview_5.models.HealthcareJobState]
:return: An instance of AsyncAnalyzeHealthcareEntitiesLROPoller that returns either HealthcareJobState or the result of cls(response)
:rtype: ~....._async_lro.AsyncAnalyzeHealthcareEntitiesLROPoller[~azure.ai.textanalytics.v3_1_preview_5.models.HealthcareJobState]
:raises ~azure.core.exceptions.HttpResponseError:
"""
api_version = self._get_api_version('begin_health')
Expand Down
Loading