Ejemplo n.º 1
0
 def requires(self):
     kwargs_for_db_import = {
         'overwrite': self.overwrite,
     }
     kwargs_for_engagement = {
         'mapreduce_engine': self.mapreduce_engine,
         'n_reduce_tasks': self.n_reduce_tasks,
         'source': self.source,
         'interval': self.interval,
         'pattern': self.pattern,
         'overwrite': self.overwrite,
         'interval_type': self.interval_type,
     }
     # For enrollment, use the default start date and the current
     # interval's end date to calculate. Note that if it's already
     # calculated, this won't check the interval that was used.
     kwargs_for_enrollment = {
         'mapreduce_engine': self.mapreduce_engine,
         'n_reduce_tasks': self.n_reduce_tasks,
         'source': self.source,
         'interval_end': self.interval.date_b,  # pylint: disable=no-member
         'pattern': self.pattern,
         'overwrite': self.overwrite,
     }
     yield (
         StudentEngagementTableTask(**kwargs_for_engagement),
         ImportAuthUserTask(**kwargs_for_db_import),
         ImportCourseUserGroupTask(**kwargs_for_db_import),
         ImportCourseUserGroupUsersTask(**kwargs_for_db_import),
         CourseEnrollmentTableTask(**kwargs_for_enrollment),
     )
     # Only the weekly requires use of the calendar.
     if self.interval_type == "weekly":
         yield (CalendarTableTask(warehouse_path=self.warehouse_path, ))
 def requires(self):
     yield (self.hive_table_task,
            UserActivityTableTask(warehouse_path=self.warehouse_path,
                                  n_reduce_tasks=self.n_reduce_tasks,
                                  overwrite=self.overwrite,
                                  overwrite_n_days=self.overwrite_n_days,
                                  date=self.end_date),
            CalendarTableTask(warehouse_path=self.warehouse_path, ))
 def required_table_tasks(self):
     yield (UserActivityTableTask(
         mapreduce_engine=self.mapreduce_engine,
         n_reduce_tasks=self.n_reduce_tasks,
         source=self.source,
         interval=self.interval,
         pattern=self.pattern,
         warehouse_path=self.warehouse_path,
     ),
            CalendarTableTask(
                warehouse_path=self.warehouse_path,
                overwrite=self.hive_overwrite,
            ))