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.44k stars 2.74k forks source link

Azure-ai-ml: Output wrongfully requires the output to be a file instead of folder. #35242

Open thomasfrederikhoeck opened 4 months ago

thomasfrederikhoeck commented 4 months ago

Describe the bug In the following link it is specified that I can supply an output folder for a batch prediction like this:

https://learn.microsoft.com/en-us/azure/machine-learning/how-to-access-data-batch-endpoints-jobs?view=azureml-api-2&tabs=sdk#create-jobs-with-data-outputs

data_path = "batch-jobs/my-unique-path"
output = Output(type=AssetTypes.URI_FOLDER, path=f"{default_ds.id}/paths/{data_path})
job = ml_client.batch_endpoints.invoke(
   endpoint_name=endpoint.name,
   inputs={ "heart_dataset": input },
   outputs={ "score": output }
)

But when I do this I'm hit with the following error which states that it needs to be a file. This doesn't make sense to me since I want to use it for outputting multiple files like here: https://learn.microsoft.com/en-us/azure/machine-learning/how-to-deploy-model-custom-output?view=azureml-api-2&tabs=python#create-a-scoring-script

HttpResponseError: The Job request provided has the following validation errors. Please resolve them and try again.
Errors:
[
  {
    "PropertyName": "OutputData.Values[0].JobOutputType",
    "ErrorMessage": "Job output type must be 'uri_file'.",
    "AttemptedValue": "uri_folder",
    "ErrorCode": "PredicateValidator"
  }
]

Content: {
  "error": {
    "code": "UserError",
    "severity": null,
    "message": "The Job request provided has the following validation errors. Please resolve them and try again.\nErrors:\n[\n  {\n    \"PropertyName\": \"OutputData.Values[0].JobOutputType\",\n    \"ErrorMessage\": \"Job output type must be 'uri_file'.\",\n    \"AttemptedValue\": \"uri_folder\",\n    \"ErrorCode\": \"PredicateValidator\"\n  }\n]\n",
    "messageFormat": null,
    "messageParameters": null,
    "referenceCode": null,
    "detailsUri": null,
    "target": null,
    "details": [],
    "innerError": {
      "code": "BadArgument",
      "innerError": {
        "code": "ArgumentInvalid",
        "innerError": {
          "code": "InvalidInputArguments",
          "innerError": null
        }
      }
    },
    "debugInfo": null,
    "additionalInfo": null
  },
  "correlation": {
    "operation": "647da9fb8a3337d978c3bb7950dac655",
    "request": "ab349cea7d170b19"
  },
  "environment": "westeurope",
  "location": "westeurope",
  "time": "2024-04-17T14:14:31.512581+00:00",
  "componentName": "managementfrontend",
  "statusCode": 400
}

To Reproduce Steps to reproduce the behavior:

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here.

github-actions[bot] commented 4 months ago

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

thomasfrederikhoeck commented 4 months ago

Hi @banibrata-de . I can see that you have been assigned. Have you been able to replicate? :-)

thomasfrederikhoeck commented 3 months ago

For extra context: https://feedback.azure.com/d365community/idea/6040f886-4409-ef11-a73c-6045bd7e8707

thomasfrederikhoeck commented 3 months ago

Hey @diondrapeck @banibrata-de . Sorry for tagging you if your are not the correct for this but do you have any update?