Skip to content

[azure-ai-ml] Fix job download and streaming regressions - #48972

Draft
Kshitij Chawla (kshitij-microsoft) wants to merge 1 commit into
Azure:mainfrom
kshitij-microsoft:fix/azure-ai-ml-job-download-stream
Draft

[azure-ai-ml] Fix job download and streaming regressions#48972
Kshitij Chawla (kshitij-microsoft) wants to merge 1 commit into
Azure:mainfrom
kshitij-microsoft:fix/azure-ai-ml-job-download-stream

Conversation

@kshitij-microsoft

Copy link
Copy Markdown
Member

Description

Fixes two azure-ai-ml 1.35.0 regressions introduced when job and datastore consumers moved to the shared TypeSpec arm_ml_service client.

Named output download

RunHistory reports output asset types in PascalCase (UriFolder, UriFile, MLTable), while the shared ARM client exposes snake_case enum values (uri_folder, uri_file, mltable). The exact comparison filtered out valid named outputs, causing MLClient.jobs.download(..., output_name=...) to complete without downloading anything.

Asset types are now normalized case- and separator-insensitively before comparison.

Fixes #48941.

Identity-based log streaming

The same enum value change activated the direct-datastore log path for URI-folder outputs. That path generates a short-lived SAS and requires a string account key or SAS token. Identity-based datastores instead provide a TokenCredential, which caused SAS generation to raise:

TypeError: argument should be a bytes-like object or ASCII string, not 'ChainedTokenCredential'

Streaming now falls back to the service-provided RunHistory log URLs when the datastore credential cannot sign a SAS. Key- and SAS-based datastores continue using the direct path.

Testing

  • python -m pytest tests/job_common/unittests/test_job_ops_helper.py -q -p no:warnings
  • Result: 6 passed, 15 skipped
  • Added regression coverage for PascalCase and snake_case output types.
  • Added regression coverage for string, TokenCredential, and missing datastore credentials.

Notes

The changes are limited to hand-written azure-ai-ml operations code, tests, and changelog. No generated code or service wire contract is changed.

Normalize job output asset types across RunHistory and ARM contracts, and fall back to RunHistory logs when an identity-based datastore credential cannot sign a SAS.

Add regression coverage for both output type spellings and identity-based log streaming.
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Download of URI folder is broken in 1.35.0

1 participant