Skip to content

Support asset-backed defaults on uri_file/uri_folder/mltable component inputs - #48676

Draft
lavakumarrepala with Copilot wants to merge 3 commits into
mainfrom
copilot/implement-asset-backed-defaults
Draft

Support asset-backed defaults on uri_file/uri_folder/mltable component inputs#48676
lavakumarrepala with Copilot wants to merge 3 commits into
mainfrom
copilot/implement-asset-backed-defaults

Conversation

Copilot AI commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

The component schema accepts a default on asset ports (InputPortSchema.default = fields.Str()), but load_component() rejected it with Default value of Input cannot be set: Non-primitive type Input has no default value., because Input._update_default() rejected every non-None default on a non-primitive type.

inputs:
  spaceship_data:
    type: uri_file
    mode: ro_mount
    default: azureml:dsp_da_test_use_case_spaceships_uri_file:50322a7173b6976c

Changes

  • constants/_component.py — added IOConstants.ASSET_TYPES_SUPPORTING_DEFAULT (uri_folder, uri_file, mltable) and added "default" to those entries in INPUT_TYPE_COMBINATION so parameter-combination validation permits it. mlflow_model/custom_model are intentionally left out.
  • entities/_inputs_outputs/input.py — new _supports_asset_default property; _update_default() now stores a string asset/path reference as-is for the supported types. Non-string defaults (123, True, a nested Input) raise UserErrorException with a message keeping the established Default value of Input '<name>' cannot be set prefix, which the dsl group tests assert on. Unsupported non-primitive types keep the original error. Docstring and the generic __init__ overload updated.
  • No serialization changes neededdefault is already in Input._IO_KEYS, so _to_dict, _to_rest_object, _from_rest_object and InputPortSchema preserve the reference, type, mode and optional semantics through YAML and REST round trips.
  • Invocation semantics fall out of the existing checks — the required-input validation in BaseNode._validate_inputs / PipelineJob already skips inputs where meta.default is not None, so an omitted input is no longer an error and the service applies the default; an explicit value still overrides it without mutating the component definition.
  • Tests/fixturestests/component/unittests/test_input_defaults.py plus input_asset_defaults_component.yml, input_asset_defaults_pipeline_component.yml, and invalid/input_asset_defaults_invalid_component.yml, covering direct construction, YAML dump/reload, REST round trip, the customer repro for command and pipeline components, override/no-mutation, invalid defaults, and primitive-default regressions.
  • CHANGELOG entry under 1.35.0.
component = load_component("pipeline_component.yaml")
component.inputs["spaceship_data"].default
# 'azureml:dsp_da_test_use_case_spaceships_uri_file:50322a7173b6976c'
component.inputs["spaceship_data"].mode  # 'ro_mount'

Notes / follow-up

  • Only string asset or path references are accepted; a nested Input object as default is not introduced, since the wire contract carries a string.
  • The public YAML reference docs and the azuremlschemas.azureedge.net schemas live outside this repo and should be aligned separately.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
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.

Copilot AI and others added 2 commits August 21, 2026 02:47
…nt inputs

Co-authored-by: lavakumarrepala <221403938+lavakumarrepala@users.noreply.github.com>
…oup behavior

Co-authored-by: lavakumarrepala <221403938+lavakumarrepala@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement support for asset-backed defaults on non-primitive inputs Support asset-backed defaults on uri_file/uri_folder/mltable component inputs Aug 21, 2026
Copilot AI requested a review from lavakumarrepala August 21, 2026 03:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants