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

EDUCATOR-4618 | Prevent csv processor objects from having duplicate columns #31

Merged
merged 1 commit into from
Sep 10, 2019

Conversation

iloveagent57
Copy link
Contributor

@iloveagent57 iloveagent57 commented Sep 9, 2019

https://openedx.atlassian.net/browse/EDUCATOR-4618

  • Adds a Mixin class to help GradesCSVProcessor and InterventionCSVProcessor manage subsection column names in a sane way.
  • Stops tox from running pydocstyle.

Merge checklist:

  • All reviewers approved
  • CI build is green
  • Version bumped
  • Changelog record added
  • Documentation updated (not only docstrings)
  • Commits are squashed

Post merge:

  • Create a tag
  • Check new version is pushed to PyPI after tag-triggered build is
    finished.
  • Delete working branch (if not needed anymore)

Screen Shot 2019-09-10 at 1 48 15 PM

@iloveagent57 iloveagent57 force-pushed the aed/fix-duplicate-columns branch 3 times, most recently from 11d3a96 to 619ae6e Compare September 9, 2019 21:15
Copy link
Contributor

@Andytr1 Andytr1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. General question: when is it good to use mixin vs a common base class?

@iloveagent57 iloveagent57 force-pushed the aed/fix-duplicate-columns branch 2 times, most recently from aaa6e01 to a4dec92 Compare September 10, 2019 17:34
Copy link
Contributor

@matthugs matthugs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrote these comments yesterday but forgot to hit send; sorry

@@ -216,3 +224,16 @@ def test_export(self, mocked_api, mocked_course_grade_factory):
processor = api.InterventionCSVProcessor(course_id=self.course_id)
rows = list(processor.get_iterator())
assert len(rows) == 2

def test_columns_not_duplicated_during_init(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would delete this test; we don't really have a user story for why this behavior would be important, since the interventions report isn't uploaded after being downloaded

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks, that's a good point.

self._course_key = CourseKey.from_string(self.course_id)
self._subsection = UsageKey.from_string(self.subsection) if self.subsection else None
self._subsections = self._get_graded_subsections(
self._course_key,
filter_subsection=self._subsection,
filter_assignment_type=self.assignment_type
filter_assignment_type=kwargs.get('assignment_type', None),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Especially when you've left a big honkin' comment about what super's init does, this seems a little unnecessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that's some copypasta from the change in GradeCSVProcessor.

@iloveagent57 iloveagent57 force-pushed the aed/fix-duplicate-columns branch from a4dec92 to 3e8dd5e Compare September 10, 2019 18:06
@iloveagent57 iloveagent57 merged commit f42c0d6 into master Sep 10, 2019
@iloveagent57 iloveagent57 deleted the aed/fix-duplicate-columns branch September 10, 2019 18:20
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

Successfully merging this pull request may close these issues.

3 participants