Azure / Azure/azureml-examples

An example on the "sdk-review" branch includes invalid function calls outdated for the recent SDK version

Open
#3,088 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Jupyter Notebook
Stars
2k
Forks
1.7k
Avg merge
18h 18m
Merged PRs (30d)
2

Description

### Operating System

MacOS

### Version Information

```bash
$ python --version
Python 3.12.1

$ az version --output yaml
azure-cli: 2.58.0
azure-cli-core: 2.58.0
azure-cli-telemetry: 1.1.0
extensions:
azure-devops: 1.0.0
ml: 2.23.0
```

### Steps to reproduce

1. Execute [this notebook](https://github.com/Azure/azureml-examples/blob/sdk-preview/sdk/jobs/pipelines/2c_nyc_taxi_data_regression/nyc_taxi_data_regression.ipynb) on the `sdk-preview` branch.

### Expected behavior

Execute the notebook without the error.

### Actual behavior

The following error happens.
```
---------------------------------------------------------------------------
ValidationException Traceback (most recent call last)
Cell In[4], line 4
1 parent_dir = ""
3 # 1. Load components
----> 4 prepare_data = load_component(path=parent_dir + "[./prep.yml](http://localhost:8888/lab/tree/prep.yml)")
5 transform_data = load_component(path=parent_dir + "[./transform.yml](http://localhost:8888/lab/tree/transform.yml)")
6 train_model = load_component(path=parent_dir + "[./train.yml](http://localhost:8888/lab/tree/train.yml)")

File [/opt/miniconda3/lib/python3.12/site-packages/azure/ai/ml/entities/_load_functions.py:416](http://localhost:8888/opt/miniconda3/lib/python3.12/site-packages/azure/ai/ml/entities/_load_functions.py#line=415), in load_component(source, relative_origin, **kwargs)
414 else:
415 msg = "One of (client, name, version), (source) should be provided."
--> 416 raise ValidationException(
417 message=msg,
418 no_personal_data_message=msg,
419 target=ErrorTarget.COMPONENT,
420 error_category=ErrorCategory.USER_ERROR,
421 error_type=ValidationErrorType.MISSING_FIELD,
422 )
423 return cast(Union[CommandComponent, ParallelComponent, PipelineComponent], component_entity)

ValidationException: One of (client, name, version), (source) should be provided.
```

### Addition information

It's an issue on the `sdk-preview` branch, not the`main` branch. And the `sdk-preview` branch might not actively be maintained. But let me share the outdated code that we found during upskilling of AML using the sample code, and I might not need to care about it.

I'm ready to make a PR to fix it. If I can update the code on the branch, please let me know. Here is the diff to fix it.
https://github.com/Azure/azureml-examples/compare/sdk-preview...polikeiji:azureml-examples:minor-fix-2c_nyc_taxi_data_regression?expand=1

Thank you for the great sample code to help us to learn AML!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.