Azure / Azure/azure-cli-extensions
"az ml computetarget create" commands are broken because of parameter name mismatch
- Dominant language
- Python
- Stars
- 454
- Forks
- 1.7k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 64
Description
**Describe the bug**
The Azure ML CLI commands:
`az ml computetarget create aks`
`az ml computetarget create amlcompute`
`az ml computetarget create datafactory`
are broken, The commands fail when invoked, displaying a message informing about "missing 1 required positional argument: 'no_wait'".
The help text for these commands does not describe the --no-wait parameter.
This is caused because there is a mismatch between the `--no-wait` parameter definitions in `$Env:UserProfile\.azure\cliextensions\azure-cli-ml\azext_ml\computetarget.py` and actual function parameters in `$Env:UserProfile\.azure\cliextensions\azure-cli-ml\azext_ml\computetarget.py`. For example:
```
command_details.json:
"ml computetarget create datafactory": {
"title": "Azure ML - ml computetarget create datafactory - DataFactory ComputeTarget Create",
"cli_command": "ml computetarget create datafactory",
"command_function": "azext_ml.computetarget#computetarget_create_datafactory",
(...)
"no_wait_flag": {
"long_form": "--no-wait",
"short_form": "",
"required": false,
"description": "Flag to not wait for asynchronous calls.",
"action": "store_true"
},
computetarget.py:
def computetarget_create_datafactory(name, location, workspace_name, resource_group, no_wait, context=cli_context,
verbose=False):
```
The parameter in command_details.json is named "no_wait_flag", but the three functions which handle the broken commands (computetarget_create_aks, computetarget_create_amlcompute, computetarget_create_datafactory) expect "no_wait".
Suggested resolution: change the parameter name in the signatures of these three functions.
**To Reproduce**
```
az ml computetarget create aks -h
```
(observe lack of mention of --no-wait)
```
az ml computetarget create aks --name mymlct-gpu-aks --agent-count 2 --vm-size Standard_NC6
{'Azure-cli-ml Version': None, 'Error': TypeError("computetarget_create_aks() missing 1 required positional argument: 'no_wait'",)}
```
**Expected behavior**
The commands execute correctly.
**Environment summary**
Azure ML CLI extension version: 1.0.10, installed following https://docs.microsoft.com/en-us/azure/machine-learning/service/reference-azure-machine-learning-cli#install-the-extension
Azure CLI version: 2.0.57, installed via Chocolatey
OS: Windows 10 1803
shell: PowerShell 5.1
**Additional context**
The commands started working correctly when I implemented the resolution suggested above locally on my machine.
Contributor guide
Assessment
This issue has not been assessed yet.