Skip to content

Commit 46b1b25

Browse files
authored
hotfix: can't use local data as node input (Azure#28229)
1 parent afbe498 commit 46b1b25

File tree

3 files changed

+799
-1
lines changed

3 files changed

+799
-1
lines changed

sdk/ml/azure-ai-ml/azure/ai/ml/entities/_resource.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def __init__(
7676
# Hide read only properties in kwargs
7777
self._id = kwargs.pop("id", None)
7878
self.__source_path: Optional[str] = kwargs.pop("source_path", None)
79-
self._base_path = kwargs.pop("base_path", os.getcwd())
79+
self._base_path = kwargs.pop("base_path", None) or os.getcwd() # base path should never be None
8080
self._creation_context = kwargs.pop("creation_context", None)
8181
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
8282
self._serialize = Serializer(client_models)

sdk/ml/azure-ai-ml/tests/dsl/e2etests/test_dsl_pipeline.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2509,3 +2509,16 @@ def my_pipeline() -> Outputs:
25092509
component = client.components.create_or_update(pipeline_job.component, _is_anonymous=True)
25102510
# pipeline component output mode is undefined behavior so we skip assert it
25112511
# assert component._to_rest_object().as_dict()["properties"]["component_spec"]["outputs"] == expected_outputs
2512+
2513+
def test_local_data_as_node_input(self, client: MLClient):
2514+
hello_world_component_yaml = "./tests/test_configs/components/helloworld_component.yml"
2515+
hello_world_component_func = load_component(source=hello_world_component_yaml)
2516+
local_data_input = Input(type="uri_folder", path="./tests/test_configs/data")
2517+
2518+
@dsl.pipeline
2519+
def my_pipeline():
2520+
hello_world_component_func(component_in_number=1, component_in_path=local_data_input)
2521+
2522+
pipeline_job: PipelineJob = my_pipeline()
2523+
pipeline_job.settings.default_compute = "cpu-cluster"
2524+
assert_job_cancel(pipeline_job, client)

0 commit comments

Comments
 (0)