Unverified Commit 6cf1345f by Andrew Zafft Committed by GitHub

Merge pull request #467 from edx/zafft/enrollment_record_ordering

fixing a bad record ordering for EnrollmentDailyRecord that was causi…
parents 4a406922 2d4ae773
...@@ -19,7 +19,7 @@ from edx.analytics.tasks.util.hive import ( ...@@ -19,7 +19,7 @@ from edx.analytics.tasks.util.hive import (
BareHiveTableTask, HivePartitionTask, OverwriteAwareHiveQueryDataTask, WarehouseMixin BareHiveTableTask, HivePartitionTask, OverwriteAwareHiveQueryDataTask, WarehouseMixin
) )
from edx.analytics.tasks.util.overwrite import OverwriteOutputMixin from edx.analytics.tasks.util.overwrite import OverwriteOutputMixin
from edx.analytics.tasks.util.record import BooleanField, DateTimeField, IntegerField, Record, StringField from edx.analytics.tasks.util.record import BooleanField, DateField, DateTimeField, IntegerField, Record, StringField
from edx.analytics.tasks.util.url import ExternalURL, UncheckedExternalURL, get_target_from_url, url_path_join from edx.analytics.tasks.util.url import ExternalURL, UncheckedExternalURL, get_target_from_url, url_path_join
from edx.analytics.tasks.warehouse.load_internal_reporting_course_catalog import ( from edx.analytics.tasks.warehouse.load_internal_reporting_course_catalog import (
CoursePartitionTask, LoadInternalReportingCourseCatalogMixin, ProgramCoursePartitionTask CoursePartitionTask, LoadInternalReportingCourseCatalogMixin, ProgramCoursePartitionTask
...@@ -504,10 +504,11 @@ class DaysEnrolledForEvents(object): ...@@ -504,10 +504,11 @@ class DaysEnrolledForEvents(object):
class CourseEnrollmentRecord(Record): class CourseEnrollmentRecord(Record):
"""A user's enrollment history.""" """A user's enrollment history."""
date = StringField(length=255, nullable=False, description='Enrollment date.') date = DateField(nullable=False, description='Enrollment date.')
course_id = StringField(length=255, nullable=False, description='The course the learner is enrolled in.') course_id = StringField(length=255, nullable=False, description='The course the learner is enrolled in.')
user_id = IntegerField(description='The user_id of the learner.') user_id = IntegerField(description='The user_id of the learner.')
at_end = BooleanField(description='An indicator if the learner is still enrolled in the course by this date.') at_end = BooleanField(description='An indicator if the learner is still enrolled in the course at then end of this '
'date.')
change = BooleanField(description='') change = BooleanField(description='')
mode = StringField(length=255, description='') mode = StringField(length=255, description='')
...@@ -741,7 +742,7 @@ class CourseEnrollmentSummaryPartitionTask(CourseEnrollmentDownstreamMixin, Hive ...@@ -741,7 +742,7 @@ class CourseEnrollmentSummaryPartitionTask(CourseEnrollmentDownstreamMixin, Hive
class EnrollmentByGenderRecord(Record): class EnrollmentByGenderRecord(Record):
"""Summarizes a course's enrollment by gender and date.""" """Summarizes a course's enrollment by gender and date."""
date = StringField(length=255, nullable=False, description='Enrollment date.') date = DateField(nullable=False, description='Enrollment date.')
course_id = StringField(length=255, nullable=False, description='The course the learners are enrolled in.') course_id = StringField(length=255, nullable=False, description='The course the learners are enrolled in.')
gender = StringField(length=6, description='The gender of the learner.') gender = StringField(length=6, description='The gender of the learner.')
count = IntegerField(description='The number of learners in the course with this gender on this date.') count = IntegerField(description='The number of learners in the course with this gender on this date.')
...@@ -887,7 +888,7 @@ class EnrollmentByGenderMysqlTask(OverwriteHiveAndMysqlDownstreamMixin, CourseEn ...@@ -887,7 +888,7 @@ class EnrollmentByGenderMysqlTask(OverwriteHiveAndMysqlDownstreamMixin, CourseEn
class EnrollmentByBirthYearRecord(Record): class EnrollmentByBirthYearRecord(Record):
"""Summarizes a course's enrollments by birth year and date.""" """Summarizes a course's enrollments by birth year and date."""
date = StringField(length=255, nullable=False, description='Enrollment date.') date = DateField(length=255, nullable=False, description='Enrollment date.')
course_id = StringField(length=255, nullable=False, description='The course the learners are enrolled in.') course_id = StringField(length=255, nullable=False, description='The course the learners are enrolled in.')
birth_year = IntegerField(description='The birth year of the learner.') birth_year = IntegerField(description='The birth year of the learner.')
count = IntegerField(description='The number of learners with this birth year enrolled in the course on this date.') count = IntegerField(description='The number of learners with this birth year enrolled in the course on this date.')
...@@ -1021,7 +1022,7 @@ class EnrollmentByBirthYearToMysqlTask(OverwriteHiveAndMysqlDownstreamMixin, Cou ...@@ -1021,7 +1022,7 @@ class EnrollmentByBirthYearToMysqlTask(OverwriteHiveAndMysqlDownstreamMixin, Cou
class EnrollmentByEducationLevelRecord(Record): class EnrollmentByEducationLevelRecord(Record):
"""Summarizes a course's enrollment by education level and date.""" """Summarizes a course's enrollment by education level and date."""
date = StringField(length=255, nullable=False, description='Enrollment date.') date = DateField(length=255, nullable=False, description='Enrollment date.')
course_id = StringField(length=255, nullable=False, description='The course the learners are enrolled in.') course_id = StringField(length=255, nullable=False, description='The course the learners are enrolled in.')
education_level = StringField(length=16, description='The education level of the learner.') education_level = StringField(length=16, description='The education level of the learner.')
count = IntegerField(description='The number of learners with this education level in the course on this date.') count = IntegerField(description='The number of learners with this education level in the course on this date.')
...@@ -1195,7 +1196,7 @@ class EnrollmentByEducationLevelMysqlTask( ...@@ -1195,7 +1196,7 @@ class EnrollmentByEducationLevelMysqlTask(
class EnrollmentByModeRecord(Record): class EnrollmentByModeRecord(Record):
"""Summarizes a course's enrollment by mode and date.""" """Summarizes a course's enrollment by mode and date."""
date = StringField(length=255, nullable=False, description='Enrollment date.') date = DateField(length=255, nullable=False, description='Enrollment date.')
course_id = StringField(length=255, nullable=False, description='The course the learners are enrolled in.') course_id = StringField(length=255, nullable=False, description='The course the learners are enrolled in.')
mode = StringField(length=255, nullable=False, description='The mode of the learner.') mode = StringField(length=255, nullable=False, description='The mode of the learner.')
count = IntegerField(description='The number of learners with this mode in the course on this date.') count = IntegerField(description='The number of learners with this mode in the course on this date.')
...@@ -1334,8 +1335,8 @@ class EnrollmentByModeTask(OverwriteHiveAndMysqlDownstreamMixin, CourseEnrollmen ...@@ -1334,8 +1335,8 @@ class EnrollmentByModeTask(OverwriteHiveAndMysqlDownstreamMixin, CourseEnrollmen
class EnrollmentDailyRecord(Record): class EnrollmentDailyRecord(Record):
"""Summarizes a course's enrollment by date.""" """Summarizes a course's enrollment by date."""
date = StringField(length=255, nullable=False, description='Enrollment date.')
course_id = StringField(length=255, nullable=False, description='The course the learners are enrolled in.') course_id = StringField(length=255, nullable=False, description='The course the learners are enrolled in.')
date = DateField(nullable=False, description='Enrollment date.')
count = IntegerField(description='The number of learners in the course on this date.') count = IntegerField(description='The number of learners in the course on this date.')
cumulative_count = IntegerField(description='The count of learners that ever enrolled in this course on or before ' cumulative_count = IntegerField(description='The count of learners that ever enrolled in this course on or before '
'this date.') 'this date.')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment