Azure / Azure/azure-sdk-for-python

Empty tags dictionary in ModelOperations.list() response

Aperta
#40,680 8 commenti 0 reazioni 1 assegnatario Assegnata a @achauhan-scc Vedi su GitHub
Client customer-reported feature-request Machine Learning needs-team-attention Service Attention
Lingua principale
Python
Stelle
5.6k
Fork
3.4k
Merge medio
2g
PR unite (30g)
217

Descrizione

- **Package Name**: `azure-ai-ml`
- **Package Version**: 1.26.3
- **Operating System**: Debian 6.1.133-1
- **Python Version**: 3.11.10

**Describe the bug**
[`ModelOperations.list()`](https://learn.microsoft.com/en-us/python/api/azure-ai-ml/azure.ai.ml.operations.modeloperations?view=azure-python#azure-ai-ml-operations-modeloperations-list) (note that `name` argument is not provided), returns an iterable of models, which `tags` attribute is always an empty dictionary.
**To Reproduce**
Steps to reproduce the behavior:
```
from azure.ai.ml import MLClient
from azure.identity import DefaultAzureCredential

client = MLClient(
credential=DefaultAzureCredential(),
subscription_id="",
resource_group_name="",
workspace_name="",
)

# tags attribute of every model in models is an empty dictionary
models = client.models.list()
```

Since the issue is caused by underlying REST API call, one call also reproduce it by calling [this endpoint](https://learn.microsoft.com/en-us/rest/api/azureml/model-containers/list?view=rest-azureml-2024-10-01&tabs=HTTP).

**Expected behavior**
[`ModelOperations.list()`](https://learn.microsoft.com/en-us/python/api/azure-ai-ml/azure.ai.ml.operations.modeloperations?view=azure-python#azure-ai-ml-operations-modeloperations-list) returns a iterable of models with tags included.

**Additional context**
Interestingly, [the corresponding API in Python SDK v1](https://learn.microsoft.com/en-us/python/api/azureml-core/azureml.core.model.model?view=azure-ml-py#azureml-core-model-model-list.) which used `/modelmanagement/v1.0/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.MachineLearningServices/workspaces/{workspace}/models` endpoint returns a list of models with tags.

I'd like to switch to SDK v2, since [v1 it's getting deprecated next year](https://learn.microsoft.com/en-us/azure/machine-learning/concept-v2?view=azureml-api-2#sdk-v2), but this bug makes the switch impossible.

An alternative approach with multiple `ModelOperations.get(name="somename")` calls (which return all the tags) is not acceptable, since I'm operating on thousands of models.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.