Azure / Azure/azure-cli-extensions

az ml pipeline list-drafts return value is difficult to parse

Open
#1,931 3 comments 0 reactions 0 assignees View on GitHub
extension/ml Service Attention
Dominant language
Python
Stars
454
Forks
1.7k
Avg merge
2d 19h
Merged PRs (30d)
64

Description

**Name of the extension**
Azure ML CLI

**Describe your issue in as much detail as possible**

Unlike other modules (such as `az ml model list`), the `list-drafts` call returns data with an additional line "PipelineDraft:" for every draft returned this way. This makes it much more difficult to parse the json programmatically because every other line must be skipped when looking for properties (such as id, name, etc.).

For example, when calling `az ml model list`, the returning data is:
```json
[
{
"createdTime": "",
"framework": "",
"frameworkVersion": "",
"id": "",
"name": "",
"version": ""
},
{
"createdTime": "",
"framework": "",
"frameworkVersion": "",
"id": "",
"name": "",
"version": ""
}
]
```

when calling `az ml pipeline list-drafts` (or `az ml pipeline list`), the return value is formatted as:

```json
[
"PipelineDraft:",
{
"Id": "",
"Last Submitted Pipeline Run Id": "",
"Name": "",
"Properties": {},
"Tags": {}
},
"PipelineDraft:",
{
"Id": "",
"Last Submitted Pipeline Run Id": "",
"Name": "",
"Properties": {},
"Tags": {}
}
]
```
---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 90bc921c-f7f2-0c82-9540-b3ee2dd471ba
* Version Independent ID: 00d7a81a-5be2-345d-200f-f89e9e8a7754
* Content: [az ml pipeline](https://docs.microsoft.com/en-us/cli/azure/ext/azure-cli-ml/ml/pipeline?view=azure-cli-latest#ext-azure-cli-ml-az-ml-pipeline-show-draft)
* Content Source: [latest/docs-ref-autogen/ext/azure-cli-ml/ml/pipeline.yml](https://github.com/MicrosoftDocs/azure-docs-cli/blob/live/latest/docs-ref-autogen/ext/azure-cli-ml/ml/pipeline.yml)
* GitHub Login: @rloutlaw
* Microsoft Alias: **routlaw**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.