Azure / azure-sdk-for-python

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.59k stars 2.8k forks source link

AttributeError: 'VirtualNetworksOperations' object has no attribute 'create_or_update' #16507

Closed hagh closed 3 years ago

hagh commented 3 years ago

Describe the bug We are following this example in our notebooks to create a virtual network, and it works fine with azure-mgmt-network==12.0.0, but on the latest version of the package, 17.0.0, we get the following error:


AttributeError Traceback (most recent call last)

in 18 network_client = NetworkManagementClient(ws._auth_object, subscription_id) 19 ---> 20 async_vnet_creation = network_client.virtual_networks.create_or_update( 21 resource_group, 22 vnet_name, AttributeError: 'VirtualNetworksOperations' object has no attribute 'create_or_update' --------------------------------------------------------------------------- **To Reproduce** Steps to reproduce the behavior: 1. Run the example linked above with the latest version of the package **Expected behavior** The example should work as is, or if things have changed the documentation and the example needs to be updated to reflect those changes. **Screenshots** N/A **Additional context** Link to notebook: https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/reinforcement-learning/atari-on-distributed-compute/pong_rllib.ipynb
ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azureml-github.

Issue Details
- **Package Name**: azure-mgmt-network - **Package Version**: 17.0.0 - **Operating System**: Windows - **Python Version**: 3.6 **Describe the bug** We are following this [example](https://docs.microsoft.com/en-us/python/api/overview/azure/network?view=azure-python#example) in our notebooks to create a virtual network, and it works fine with azure-mgmt-network==12.0.0, but on the latest version of the package, 17.0.0, we get the following error: --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in 18 network_client = NetworkManagementClient(ws._auth_object, subscription_id) 19 ---> 20 async_vnet_creation = network_client.virtual_networks.create_or_update( 21 resource_group, 22 vnet_name, AttributeError: 'VirtualNetworksOperations' object has no attribute 'create_or_update' --------------------------------------------------------------------------- **To Reproduce** Steps to reproduce the behavior: 1. Run the example linked above with the latest version of the package **Expected behavior** The example should work as is, or if things have changed the documentation and the example needs to be updated to reflect those changes. **Screenshots** N/A **Additional context** Link to notebook: https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/reinforcement-learning/atari-on-distributed-compute/pong_rllib.ipynb
Author: hagh
Assignees: -
Labels: `Machine Learning`, `Mgmt`, `Service Attention`
Milestone: -
lmazuel commented 3 years ago

Hi @hagh I'm tagging the ML team to update the sample. In the meantime, all long running operations starts with begin_ now (begin_create_or_update)

CC @jsntcy

hagh commented 3 years ago

Hi @lmazuel,

Thanks for looking into this. I tried to use begin_create_or_update before submitting this issue, but looks like it needs additional input parameters, and without that additional input it fails down the stack. There is no example on how to use it to avoid those error. Also according to documentation begin_create_or_update has been available with older versions as well. create_or_update sounds more like an alias, a wrapper, or a convenience method which is missing in the later versions (16.0.0. and 17.0.0). I could be wrong.

v-strudm-msft commented 3 years ago

Hello @lmazuel, please review for re-assignment to another product team. Thanks!

lmazuel commented 3 years ago

@v-strudm-msft I'm unsure why you removed the label I put :(. Please let me know on Teams if you disagree with them

ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @azureml-github.

Issue Details
- **Package Name**: azure-mgmt-network - **Package Version**: 17.0.0 - **Operating System**: Windows - **Python Version**: 3.6 **Describe the bug** We are following this [example](https://docs.microsoft.com/en-us/python/api/overview/azure/network?view=azure-python#example) in our notebooks to create a virtual network, and it works fine with azure-mgmt-network==12.0.0, but on the latest version of the package, 17.0.0, we get the following error: --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in 18 network_client = NetworkManagementClient(ws._auth_object, subscription_id) 19 ---> 20 async_vnet_creation = network_client.virtual_networks.create_or_update( 21 resource_group, 22 vnet_name, AttributeError: 'VirtualNetworksOperations' object has no attribute 'create_or_update' --------------------------------------------------------------------------- **To Reproduce** Steps to reproduce the behavior: 1. Run the example linked above with the latest version of the package **Expected behavior** The example should work as is, or if things have changed the documentation and the example needs to be updated to reflect those changes. **Screenshots** N/A **Additional context** Link to notebook: https://github.com/Azure/MachineLearningNotebooks/blob/master/how-to-use-azureml/reinforcement-learning/atari-on-distributed-compute/pong_rllib.ipynb
Author: hagh
Assignees: bandsina
Labels: `Client`, `Machine Learning`, `Service Attention`, `customer-reported`
Milestone: -
lmazuel commented 3 years ago

@hagh sorry but you're incorrect, begin_create_or_update is the new nomenclature we renamed create_or_update from (I did the change myself in the code generator :p).

The new generic samples repo is here: https://github.com/Azure-Samples/azure-samples-python-management

But I don't know if they have this scenario yet (CC @jsntcy @changlong-liu )

jsntcy commented 3 years ago

@hagh, please see code example here: https://github.com/Azure-Samples/azure-samples-python-management/blob/master/samples/network/virtual_network/manage_virtual_network.py#L37

ghost commented 3 years ago

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

rubendv commented 3 years ago

The documentation still mentions create_or_update: https://docs.microsoft.com/en-us/python/api/overview/azure/network?view=azure-python

ghost commented 3 years ago

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!