def reducer(self, key, values):
        """Emit records for each day the user was enrolled in the course."""
        course_id, user_id = key

        earliest_timestamp_value = None
        if self.earliest_timestamp is not None:
            earliest_timestamp_value = ensure_microseconds(
                self.earliest_timestamp.isoformat()  # pylint: disable=no-member
            )
        expected_validation_value = None
        if self.expected_validation is not None:
            expected_validation_value = ensure_microseconds(
                self.expected_validation.isoformat()  # pylint: disable=no-member
            )
        options = {
            'tuple_output': self.tuple_output,
            'include_nonstate_changes': self.include_nonstate_changes,
            'generate_before': self.generate_before,
            'lower_bound_date_string': self.lower_bound_date_string,
            'earliest_timestamp': earliest_timestamp_value,
            'expected_validation': expected_validation_value,
        }
        event_stream_processor = ValidateEnrollmentForEvents(
            course_id, user_id, self.interval, values, **options
        )
        for datestamp, missing_enroll_event in event_stream_processor.missing_enrolled():
            yield datestamp, missing_enroll_event
Beispiel #2
0
    def reducer(self, key, values):
        """Emit records for each day the user was enrolled in the course."""
        course_id, user_id = key

        earliest_timestamp_value = None
        if self.earliest_timestamp is not None:
            earliest_timestamp_value = ensure_microseconds(
                self.earliest_timestamp.isoformat()  # pylint: disable=no-member
            )
        expected_validation_value = None
        if self.expected_validation is not None:
            expected_validation_value = ensure_microseconds(
                self.expected_validation.isoformat()  # pylint: disable=no-member
            )
        options = {
            'tuple_output': self.tuple_output,
            'include_nonstate_changes': self.include_nonstate_changes,
            'generate_before': self.generate_before,
            'lower_bound_date_string': self.lower_bound_date_string,
            'earliest_timestamp': earliest_timestamp_value,
            'expected_validation': expected_validation_value,
        }
        event_stream_processor = ValidateEnrollmentForEvents(
            course_id, user_id, self.interval, values, **options)
        for datestamp, missing_enroll_event in event_stream_processor.missing_enrolled(
        ):
            yield datestamp, missing_enroll_event
    def reducer(self, key, values):
        """Emit records for each day the user was enrolled in the course."""
        course_id, user_id = key

        earliest_timestamp_value = None
        if self.earliest_timestamp is not None:
            earliest_timestamp_value = ensure_microseconds(self.earliest_timestamp.isoformat())
        expected_validation_value = None
        if self.expected_validation is not None:
            expected_validation_value = ensure_microseconds(self.expected_validation.isoformat())

        options = {
            "tuple_output": self.tuple_output,
            "include_nonstate_changes": self.include_nonstate_changes,
            "generate_before": self.generate_before,
            "lower_bound_date_string": self.lower_bound_date_string,
            "earliest_timestamp": earliest_timestamp_value,
            "expected_validation": expected_validation_value,
        }
        event_stream_processor = ValidateEnrollmentForEvents(course_id, user_id, self.interval, values, **options)
        for datestamp, missing_enroll_event in event_stream_processor.missing_enrolled():
            yield datestamp, missing_enroll_event