[formrecognizer] adds AsyncLROPoller and continuation token support#11650
[formrecognizer] adds AsyncLROPoller and continuation token support#11650kristapratico merged 22 commits intoAzure:masterfrom
Conversation
iscai-msft
left a comment
There was a problem hiding this comment.
thank you for all of your hard work, you're a star
| self._client = FormRecognizer( | ||
| endpoint=endpoint, | ||
| credential=credential, | ||
| credential=credential, # type: ignore |
There was a problem hiding this comment.
What is the typing issue here?
There was a problem hiding this comment.
error: Argument "credential" to "FormRecognizerClient" has incompatible type "Union[AzureKeyCredential, TokenCredential]"; expected "TokenCredential"
| """ | ||
|
|
||
| polling_interval = kwargs.pop("polling_interval", POLLING_INTERVAL) | ||
| continuation_token = kwargs.pop("continuation_token", None) |
There was a problem hiding this comment.
Since you're just popping continuation_token and putting it back in, you should just not pop it at all, as the kwargs passed into the function call will have it
There was a problem hiding this comment.
I'd like to do that but in many of the methods I'm controlling the lro_algorithm so I need to pass in, e.g., LROBasePolling(**kwargs) myself into the generated call. I need to pop it here so it doesn't get passed into the polling method.
| deserialization_callback = cls if cls else callback | ||
|
|
||
| if continuation_token: | ||
| return LROPoller.from_continuation_token( |
There was a problem hiding this comment.
How come begin_train_model calls LROPoller.from_continuation_token, while the other polling methods do not call it if a continuation token is present
There was a problem hiding this comment.
This one doesn't generate as an LRO (although it is an LRO). It uses Location polling which should not be used for POST/201, from my understanding. I believe there is an issue open in autorest to handle this, but for now I have to work around it like this. The other methods do call it if continuation_token is present, but in the generated code.
...ecognizer/azure-ai-formrecognizer/azure/ai/formrecognizer/aio/_form_training_client_async.py
Outdated
Show resolved
Hide resolved
| response, | ||
| deserialization_callback, | ||
| AsyncLROBasePolling(timeout=polling_interval, lro_algorithms=[TrainingPolling()], **kwargs) | ||
| AsyncLROBasePolling( # type: ignore |
There was a problem hiding this comment.
Why is there a type ignore comment here?
There was a problem hiding this comment.
error: Argument 4 to "AsyncLROPoller" has incompatible type "AsyncLROBasePolling"; expected "AsyncPollingMethod[Any]"
Network november release (Azure#13224) * Adds base for updating Microsoft.Network from version stable/2020-08-01 to version 2020-11-01 * Updates readme * Updates API version in new specs and examples * No snat firewall policy (Azure#12505) * Adding No SNAT feature support to firewall policy * committing prettier-fix * adding period at end of description to prevent failure for checks * Insights on Firewall Policy (Azure#12509) * Adds base for updating Microsoft.Network from version stable/2020-07-01 to version 2020-08-01 * Updates readme * Updates API version in new specs and examples * add patch operation for express route gateway (Azure#11553) * add patch * fix example * Added new cloud service NIC and PIP APIs (Azure#11650) Co-authored-by: Richa Jain <[email protected]> * Adding support for Vpn Link Connection Mode (Azure#11574) Co-authored-by: Abhishek Shah <[email protected]> * Reverting the changes made for address space update as the changes in service code are not in yet (Azure#11754) Co-authored-by: Hari Prasad Perabattula <[email protected]> * VPN NAT for Virtual WAN feature changes (Azure#11815) * VPN NAT for Virtual WAN feature changes * PrettierCheck fixes * Incorporate review comments and update examples * Add edge zone parameters for networking resources and add extendedLocation property to customIpPrefix (Azure#11933) * Add extendedLocation property to customIpPrefix * Fix the directory * Address linting errors * Fix another linting error * Add edge zone parameter for network interfaces * Looks like edgeZone parameter is working when creating network interfaces * EdgeZone parameter for load balancer * Add edge zone parameter for public IP address * Add edge zone parameter for public IP prefix * Add edgeZone parameter for virtual networks * Add edge zone parameter for custom IP prefix Co-authored-by: Will Ehrich <[email protected]> * Add location parameter to Loadbalancer Backend Address Pool Properties Format (Azure#11919) * adding location parameter to backendaddresspoolpropertiesformat * ran prettier * Support for Listing IKE Security Associations for Virtual Network Gateway Connections (Azure#11572) * Support to List IKE SAs on VNG Connection * Updating GetIkeSas * Update virtualNetworkGateway.json * Added location headers * Update virtualNetworkGateway.json * Prettier fix * Update custom-words.txt * Update virtualNetworkGateway.json * Update custom-words.txt * Update virtualNetworkGateway.json * Update virtualNetworkGateway.json * Update virtualNetworkGateway.json Co-authored-by: Abhishek Shah <[email protected]> * [Fix] GetIkeSas returns result as string (Azure#12225) * Removing IkeSaParameters * Update custom-words.txt * Update virtualNetworkGateway.json * Update virtualNetworkGateway.json * Update VirtualNetworkGatewayConnectionGetIkeSas.json * Update virtualNetworkGateway.json * Update VirtualNetworkGatewayConnectionGetIkeSas.json Co-authored-by: Abhishek Shah <[email protected]> * Add extended location properties for private link service and private endpoints and remove edge zone properties (Azure#12039) * Remove edge zone parameter * Add extended location for private endpoint and private link service * Add examples * Capitalization * Prettier Co-authored-by: Will Ehrich <[email protected]> * Add missing properties of SecurityRule, Route and RouteTable (Azure#12215) * Add missing properties of SecurityRule Route and RouteTable * Set resourceGuid field to be read only Co-authored-by: Xu Wang <[email protected]> * Added placeholder instead of password (Azure#12299) * resolving conflicts * resolving conflicts * new api version * resolving conflicts * fixing network validation * running prettier * fixing network valdiation * fixing network valdiation Co-authored-by: Mikhail <[email protected]> Co-authored-by: nimaller <[email protected]> Co-authored-by: Richa Jain <[email protected]> Co-authored-by: Richa Jain <[email protected]> Co-authored-by: Abhishek Shah <[email protected]> Co-authored-by: Abhishek Shah <[email protected]> Co-authored-by: Hari Prasad Perabattula <[email protected]> Co-authored-by: Hari Prasad Perabattula <[email protected]> Co-authored-by: Nilambari <[email protected]> Co-authored-by: William Ehrich <[email protected]> Co-authored-by: Will Ehrich <[email protected]> Co-authored-by: Kayden Wilkinson <[email protected]> Co-authored-by: Xu Wang <[email protected]> Co-authored-by: Xu Wang <[email protected]> * Firewall Policy Insights with region (Azure#12711) * Adds base for updating Microsoft.Network from version stable/2020-07-01 to version 2020-08-01 * Updates readme * Updates API version in new specs and examples * add patch operation for express route gateway (Azure#11553) * add patch * fix example * Added new cloud service NIC and PIP APIs (Azure#11650) Co-authored-by: Richa Jain <[email protected]> * Adding support for Vpn Link Connection Mode (Azure#11574) Co-authored-by: Abhishek Shah <[email protected]> * Reverting the changes made for address space update as the changes in service code are not in yet (Azure#11754) Co-authored-by: Hari Prasad Perabattula <[email protected]> * VPN NAT for Virtual WAN feature changes (Azure#11815) * VPN NAT for Virtual WAN feature changes * PrettierCheck fixes * Incorporate review comments and update examples * Add edge zone parameters for networking resources and add extendedLocation property to customIpPrefix (Azure#11933) * Add extendedLocation property to customIpPrefix * Fix the directory * Address linting errors * Fix another linting error * Add edge zone parameter for network interfaces * Looks like edgeZone parameter is working when creating network interfaces * EdgeZone parameter for load balancer * Add edge zone parameter for public IP address * Add edge zone parameter for public IP prefix * Add edgeZone parameter for virtual networks * Add edge zone parameter for custom IP prefix Co-authored-by: Will Ehrich <[email protected]> * Add location parameter to Loadbalancer Backend Address Pool Properties Format (Azure#11919) * adding location parameter to backendaddresspoolpropertiesformat * ran prettier * Support for Listing IKE Security Associations for Virtual Network Gateway Connections (Azure#11572) * Support to List IKE SAs on VNG Connection * Updating GetIkeSas * Update virtualNetworkGateway.json * Added location headers * Update virtualNetworkGateway.json * Prettier fix * Update custom-words.txt * Update virtualNetworkGateway.json * Update custom-words.txt * Update virtualNetworkGateway.json * Update virtualNetworkGateway.json * Update virtualNetworkGateway.json Co-authored-by: Abhishek Shah <[email protected]> * [Fix] GetIkeSas returns result as string (Azure#12225) * Removing IkeSaParameters * Update custom-words.txt * Update virtualNetworkGateway.json * Update virtualNetworkGateway.json * Update VirtualNetworkGatewayConnectionGetIkeSas.json * Update virtualNetworkGateway.json * Update VirtualNetworkGatewayConnectionGetIkeSas.json Co-authored-by: Abhishek Shah <[email protected]> * Add extended location properties for private link service and private endpoints and remove edge zone properties (Azure#12039) * Remove edge zone parameter * Add extended location for private endpoint and private link service * Add examples * Capitalization * Prettier Co-authored-by: Will Ehrich <[email protected]> * Add missing properties of SecurityRule, Route and RouteTable (Azure#12215) * Add missing properties of SecurityRule Route and RouteTable * Set resourceGuid field to be read only Co-authored-by: Xu Wang <[email protected]> * Added placeholder instead of password (Azure#12299) * resolving conflicts * resolving conflicts * new api version * resolving conflicts * fixing network validation * running prettier * fixing network valdiation * fixing network valdiation * Passing in the regions to backend * changed the reference definition Co-authored-by: Mikhail <[email protected]> Co-authored-by: nimaller <[email protected]> Co-authored-by: Richa Jain <[email protected]> Co-authored-by: Richa Jain <[email protected]> Co-authored-by: Abhishek Shah <[email protected]> Co-authored-by: Abhishek Shah <[email protected]> Co-authored-by: Hari Prasad Perabattula <[email protected]> Co-authored-by: Hari Prasad Perabattula <[email protected]> Co-authored-by: Nilambari <[email protected]> Co-authored-by: William Ehrich <[email protected]> Co-authored-by: Will Ehrich <[email protected]> Co-authored-by: Kayden Wilkinson <[email protected]> Co-authored-by: Xu Wang <[email protected]> Co-authored-by: Xu Wang <[email protected]> * Support for Listing IKE Security Associations for VPN Link Connections (Azure#12305) * Adds base for updating Microsoft.Network from version stable/2020-07-01 to version 2020-08-01 * Updates readme * Updates API version in new specs and examples * add patch operation for express route gateway (Azure#11553) * add patch * fix example * Added new cloud service NIC and PIP APIs (Azure#11650) Co-authored-by: Richa Jain <[email protected]> * Adding support for Vpn Link Connection Mode (Azure#11574) Co-authored-by: Abhishek Shah <[email protected]> * Reverting the changes made for address space update as the changes in service code are not in yet (Azure#11754) Co-authored-by: Hari Prasad Perabattula <[email protected]> * VPN NAT for Virtual WAN feature changes (Azure#11815) * VPN NAT for Virtual WAN feature changes * PrettierCheck fixes * Incorporate review comments and update examples * Add edge zone parameters for networking resources and add extendedLocation property to customIpPrefix (Azure#11933) * Add extendedLocation property to customIpPrefix * Fix the directory * Address linting errors * Fix another linting error * Add edge zone parameter for network interfaces * Looks like edgeZone parameter is working when creating network interfaces * EdgeZone parameter for load balancer * Add edge zone parameter for public IP address * Add edge zone parameter for public IP prefix * Add edgeZone parameter for virtual networks * Add edge zone parameter for custom IP prefix Co-authored-by: Will Ehrich <[email protected]> * Add location parameter to Loadbalancer Backend Address Pool Properties Format (Azure#11919) * adding location parameter to backendaddresspoolpropertiesformat * ran prettier * Support for Listing IKE Security Associations for Virtual Network Gateway Connections (Azure#11572) * Support to List IKE SAs on VNG Connection * Updating GetIkeSas * Update virtualNetworkGateway.json * Added location headers * Update virtualNetworkGateway.json * Prettier fix * Update custom-words.txt * Update virtualNetworkGateway.json * Update custom-words.txt * Update virtualNetworkGateway.json * Update virtualNetworkGateway.json * Update virtualNetworkGateway.json Co-authored-by: Abhishek Shah <[email protected]> * [Fix] GetIkeSas returns result as string (Azure#12225) * Removing IkeSaParameters * Update custom-words.txt * Update virtualNetworkGateway.json * Update virtualNetworkGateway.json * Update VirtualNetworkGatewayConnectionGetIkeSas.json * Update virtualNetworkGateway.json * Update VirtualNetworkGatewayConnectionGetIkeSas.json Co-authored-by: Abhishek Shah <[email protected]> * Add extended location properties for private link service and private endpoints and remove edge zone properties (Azure#12039) * Remove edge zone parameter * Add extended location for private endpoint and private link service * Add examples * Capitalization * Prettier Co-authored-by: Will Ehrich <[email protected]> * Add missing properties of SecurityRule, Route and RouteTable (Azure#12215) * Add missing properties of SecurityRule Route and RouteTable * Set resourceGuid field to be read only Co-authored-by: Xu Wang <[email protected]> * Added placeholder instead of password (Azure#12299) * Adding getikesas for vpn link connections * pretty fix * Naming * Update VpnSiteLinkConnectionGetIkeSas.json * Update VpnSiteLinkConnectionGetIkeSas.json * Changing API version * Update readme.md * Updating API version * Removing changes from older API * Update virtualWan.json Co-authored-by: Mikhail <[email protected]> Co-authored-by: nimaller <[email protected]> Co-authored-by: Richa Jain <[email protected]> Co-authored-by: Richa Jain <[email protected]> Co-authored-by: Abhishek Shah <[email protected]> Co-authored-by: Hari Prasad Perabattula <[email protected]> Co-authored-by: Hari Prasad Perabattula <[email protected]> Co-authored-by: Nilambari <[email protected]> Co-authored-by: William Ehrich <[email protected]> Co-authored-by: Will Ehrich <[email protected]> Co-authored-by: Kayden Wilkinson <[email protected]> Co-authored-by: Xu Wang <[email protected]> Co-authored-by: Xu Wang <[email protected]> * Added 'Subnet' property to LoadBalancerBackendAddress (Azure#12625) * Support for ResetConnection for VNG and VPN Link connections (Azure#12715) * fix the name mismatch (Azure#12826) * Add support for Traffic selector param in VpnConnection for virtualWan (Azure#12903) * Add support for Traffic selector param in Connection - initial changes * Add trafficSelectorPolicies list in responses * Add trafficSelectorPolicies list in Get and List connection * cleanup stostools (Azure#12699) * Revert "Merge branch 'network-november-release' into ak-traffic-selector" This reverts commit 1a8f61e3c4395f410d6ff16ee41da4d2eeb091b5, reversing changes made to 3c90ff8ccb6c1e46c0480643906d6b5c5388e8c8. Co-authored-by: Zhenglai Zhang <[email protected]> * Revert "Add support for Traffic selector param in VpnConnection for virtualWan" (Azure#13088) * Revert "Add support for Traffic selector param in VpnConnection for virtualWan (Azure#12903)" This reverts commit 34dcf04f0ee453fa739ec2f790376a8decb5a3ab. * cleanup stostools (Azure#12699) Co-authored-by: Zhenglai Zhang <[email protected]> * Re - Add support for Traffic selector param in VpnConnection for virtualWan (Azure#13103) * Add support for Traffic selector param in Connection - initial changes * Add trafficSelectorPolicies list in responses * Add trafficSelectorPolicies list in Get and List connection * add auth type property to vng config (Azure#13183) * added reverted by mistake api version * fixed mistyping * Fix name mismatch for virtual network local gateway (Azure#13266) * fix the name mismatch * fix name mismatch in nov Co-authored-by: nikhilpadhye1 <[email protected]> Co-authored-by: Sai Sujith Reddy Mankala <[email protected]> Co-authored-by: nimaller <[email protected]> Co-authored-by: Richa Jain <[email protected]> Co-authored-by: Richa Jain <[email protected]> Co-authored-by: Abhishek Shah <[email protected]> Co-authored-by: Abhishek Shah <[email protected]> Co-authored-by: Hari Prasad Perabattula <[email protected]> Co-authored-by: Hari Prasad Perabattula <[email protected]> Co-authored-by: Nilambari <[email protected]> Co-authored-by: William Ehrich <[email protected]> Co-authored-by: Will Ehrich <[email protected]> Co-authored-by: Kayden Wilkinson <[email protected]> Co-authored-by: Xu Wang <[email protected]> Co-authored-by: Xu Wang <[email protected]> Co-authored-by: irrogozh <[email protected]> Co-authored-by: Akshat Kale <[email protected]> Co-authored-by: litchiyangMSFT <[email protected]> Co-authored-by: Zhenglai Zhang <[email protected]> Co-authored-by: neethirshetty <[email protected]>
Resolves #11530
TODO: