Skip to content
This repository was archived by the owner on Sep 25, 2026. It is now read-only.

remove file_name argument because it's not used in function - #252

Merged
Eugene Fedorenko (eedorenko) merged 1 commit into
microsoft:masterfrom
cindyweng:patch-1
Apr 8, 2020
Merged

Eugene Fedorenko (eedorenko) merged 1 commit into
microsoft:masterfrom
cindyweng:patch-1

Conversation

@cindyweng

Copy link
Copy Markdown
Contributor

No description provided.

@cindyweng

Copy link
Copy Markdown
Contributor Author

Leaving "file_name" argument in also causes the AML pipeline to fail because elsewhere in the CI pipeline, the function is called without a filename argument, and throws an error.

@cindyweng Cindy Weng (cindyweng) changed the title remove file_name parameter because it's not used in function remove file_name argument because it's not used in function Apr 6, 2020
@martin-weber

Martin Weber (martin-weber) commented Apr 6, 2020 •

Copy link
Copy Markdown
Member

I was running into the same issue, see #253 .
Another solution would be to first do the file_name assignment and then call create_sample_data_csv(file_name) in lines 62 and 65 in ml_service/pipelines/diabetes_regression_build_train_pipeline.py as described in #253 .
And move the constant file_name in df.to_csv(...) to a default argument of the function:

import pandas as pd
from sklearn.datasets import load_diabetes


# Loads the diabetes sample data from sklearn and produces a csv file that can
# be used by the build/train pipeline script.
def create_sample_data_csv(file_name='diabetes.csv'):
    sample_data = load_diabetes()
    df = pd.DataFrame(
        data=sample_data.data,
        columns=sample_data.feature_names)
    df['Y'] = sample_data.target
    # Hard code to diabetes so we fail fast if the project has been
    # bootstrapped.
    df.to_csv(file_name, index=False)

@cindyweng

Copy link
Copy Markdown
Contributor Author

Martin Weber (@martin-weber) I looked into those changes but chose this solution purely because it was fewer code edits and didn't seem to bork anything :)

@martin-weber

Copy link
Copy Markdown
Member

Cindy Weng (@cindyweng) Fine for me. Both solutions work.

@eedorenko
Eugene Fedorenko (eedorenko) merged commit bb62f3d into microsoft:master Apr 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants