Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong variables in example #22

Open
minhsphuc12 opened this issue Sep 30, 2020 · 1 comment
Open

Wrong variables in example #22

minhsphuc12 opened this issue Sep 30, 2020 · 1 comment

Comments

@minhsphuc12
Copy link

cols = len(expected_data.columns)

You should use data_transformed not expected_data for actual transformation output.

@minhsphuc12 minhsphuc12 changed the title Wrong value in example Wrong variables in example Sep 30, 2020
@Philipkk
Copy link

Exactly. self.assertEqual(expected_cols, cols) should compare the length of expected_data.columns with the length of data_transformed.columns. But current code compares length of expected_data.columns with itself, according to line 53, 64 and 73.

line 53 expected_cols = len(expected_data.columns)

line 64 cols = len(expected_data.columns)

line 73 self.assertEqual(expected_cols, cols)

Seems 3 typos in total. rows and avg_steps also need to be updated. Replace variable expected_data as data_transformed in line 64, 65 and 67, as following

    cols = len(data_transformed.columns)
    rows = data_transformed.count()
    avg_steps = (
        data_transformed
        .agg(mean('steps_to_desk').alias('avg_steps_to_desk'))
        .collect()[0]
        ['avg_steps_to_desk'])

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

No branches or pull requests

2 participants