Skip to content

Commit

Permalink
doc: update design proposal for consuming
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotzh committed Oct 18, 2022
1 parent 277c2b4 commit 3f4cbe1
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions sdk/ml/azure-ai-ml/tests/internal/e2etests/test_component.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,37 @@ def test_component_load(

# TODO: check if loaded environment is expected to be an ordered dict
assert pydash.omit(loaded_dict, *omit_fields) == pydash.omit(expected_dict, *omit_fields)

def test_component_with_default_label(
self,
client: MLClient,
randstr: Callable[[str], str],
yaml_path: str,
) -> None:
component_name = randstr("component_name")

create_component(client, component_name, path=yaml_path)

default_component = client.components.get(component_name)

# plan A: the version will be set to azureml_default
# pros:
# 1. easy to implement
# 2. unified solution for all component label (azureml_labela, e.g.)
# cons:
# 1. can't update component based on loaded component
# 2. the hidden keyword is exposed to user so not so safe
assert default_component.version == "azureml_default"

# plan B: use a protected field to indicate the label
# pros:
# 1. can be used to update component
# 2. hide keyword from user
# 3. unified solution for all component label
# pros:
# 1. introduce a new "protected" field like "_is_anonymous"
assert default_component._label == "default"
# or add a special logic in job_operations so all behaviour is hidden from public interface?
assert default_component.id == f"{component_name}:azureml_default"
assert default_component.version == "1"

0 comments on commit 3f4cbe1

Please sign in to comment.