mitodl / edx2bigquery

Tool to convert & load data from edX platform into BigQuery
GNU General Public License v2.0
29 stars 29 forks source link

Course ids fix #60

Closed AbdouSeck closed 7 years ago

AbdouSeck commented 7 years ago

Changes:

1) Inside file make_grades_persistent.py Added fix_course_ids to change course ids to their expected format in make_grades_persistent.py

2) Changed remove_nulls_from_grade_persistent to cleanup_rows_from_grade_persistent in make_grades_persistent.py to make it a more general function.

Note: I also noticed the call to make_grades_persistent.already_exists in main.py, but there is no already_exists function defined in make_grades_persistent.py. This could cause errors in the future. @lstmemery, is this trying to access the same function defined in make_grading_policy_table.py?

lstmemery commented 7 years ago

You are correct. It should be make_grading_policy_table.already_exists, not make_grades_persistent.already_exists. This was the result of a sloppy refactoring on my part. Could you please correct my mistake?

AbdouSeck commented 7 years ago

@lstmemery the function should now be accessed from the right module. Thanks!

ichuang commented 7 years ago

Thanks Abdou!

BTW, note that fix_course_ids() need not return the dict (and the call need not replace row_dict), because row_dict is passed by reference and modifications happen in-place.

AbdouSeck commented 7 years ago

I just picked up on that. I am always trying to avoid doing anything by reference in python. But this won't cause much damage other than time wasted assigning row_dict back to itself. I'll fix it next time something comes up. Thanks!