Skip to content

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

Merged
iscai-msft merged 7 commits intoAzure:masterfrom
iscai-msft:fix_paging_types
Jun 3, 2021
Merged

[text analytics] Fix some issues i've found#19081
iscai-msft merged 7 commits intoAzure:masterfrom
iscai-msft:fix_paging_types

Conversation

@iscai-msft
Copy link
Contributor

  1. Remove custom pager: we don't need it
  2. Fix AnalyzeHealthcareEntitiesResult's statistics property to be the correct type (TextDocumentStatistics)
  3. Remove RequestStatistics (it was a duplicate of TextDocumentBatchStatistics)
  4. Fix names of the LRO pollers and polling methods, and fix the typing and documentation to refer to the custom pollers instead of LROPoller
  5. Make typehints for async functions not commented
  6. Add documentation strings for the metadata exposed on the custom LRO pollers

fixes #19014, #16668, #16483

…into fix_paging_types

* 'master' of https://github.com/Azure/azure-sdk-for-python: (37 commits)
  [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)
  [ACR] prerelease (Azure#19028)
  Add sdk/core to triggers and pr (Azure#19023)
  Event grid 4.3.0 regen code  (Azure#19025)
  Handle 6 decimal places cloud event (Azure#19019)
  ...
@iscai-msft iscai-msft requested a review from kristapratico June 3, 2021 18:31
@iscai-msft iscai-msft requested a review from abhahn as a code owner June 3, 2021 18:31
class AnalyzeHealthcareEntitiesLROPoller(LROPoller):
class AnalyzeHealthcareEntitiesLROPoller(LROPoller, Generic[PollingReturnType]):

def polling_method(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

do users need to access this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, this was for typing basically. It's inherited from LROPoller, but since I added metadata on my pollers + polling methods (metadata on polling methods isn't really exposed to users, but is used to pass info to the poller), I'm using the polling method to let mypy know that "yep, my poller / polling method really has these metadata attributes"

for idx, resp in enumerate(response):
self.assertEqual(resp.id, expected_order[idx])
assert resp.id == expected_order[idx]
if resp.is_error:
Copy link
Contributor

Choose a reason for hiding this comment

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

are we expecting errors in this test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, one of them is an empty doc

@iscai-msft iscai-msft merged commit 0282a23 into Azure:master Jun 3, 2021
@iscai-msft iscai-msft deleted the fix_paging_types branch June 3, 2021 20:31
iscai-msft added a commit to iscai-msft/azure-sdk-for-python that referenced this pull request Jun 3, 2021
…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)
  ...
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.

[text analytics] have async typehints be not commented

2 participants