Skip to content

Cherrypick- Fix BatchEndpoint.defaults regression: restore attribute-access object from get() - #47931

Merged
Chakradhar886 merged 4 commits into
release/azure-ai-ml/1.34.1from
cherryfix/ayush/hotfix
Jul 9, 2026
Merged

Cherrypick- Fix BatchEndpoint.defaults regression: restore attribute-access object from get()#47931
Chakradhar886 merged 4 commits into
release/azure-ai-ml/1.34.1from
cherryfix/ayush/hotfix

Conversation

@Chakradhar886

Copy link
Copy Markdown
Member

Cherry-pick of #47813 onto release/azure-ai-ml/1.34.1.

Restores attribute-access object returned from BatchEndpoint.defaults.get() to fix regression.

…c client (#47944)

* Fix datastore create TypeError: serialize msrest body for the TypeSpec client (ICM 829788361)

az ml datastore create (and MLClient.datastores.create_or_update) failed on azure-ai-ml
1.34.0 with 'TypeError: Object of type Datastore is not JSON serializable'. The datastore
operation was migrated to the TypeSpec/arm_ml_service client, whose SdkJSONEncoder only
serializes hybrid (_is_model) models, but the datastore entity _to_rest_object() still builds
a legacy msrest (v2023_04) Datastore model. json.dumps(model, cls=SdkJSONEncoder) fell through
to json.JSONEncoder.default and raised before any HTTP request.

Fix: serialize the msrest model to its camelCase wire dict (body=ds_request.serialize()) before
passing it to the operation (which accepts Union[Datastore, JSON, IO[bytes]]). Byte-identical to
1.33.0 for all datastore types x credentials (blob/file/adls gen1+2/onelake x none/account-key/
sas/service-principal/certificate), verified offline. The response read path already handles both
msrest and hybrid objects.

Added a regression test that captures the request body and asserts it serializes cleanly with the
client's SdkJSONEncoder; it fails on the unfixed code (reproducing the TypeError) and passes with
the fix. The pre-existing test_create only asserted the mocked op was called, so it never
exercised serialization.

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Azure Azure deleted a comment from azure-pipelines Bot Jul 9, 2026
@Chakradhar886
Chakradhar886 merged commit 76233f8 into release/azure-ai-ml/1.34.1 Jul 9, 2026
18 checks passed
@Chakradhar886
Chakradhar886 deleted the cherryfix/ayush/hotfix branch July 9, 2026 07:54
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.

3 participants