appsembler / figures

Reporting and data retrieval app for Open edX
MIT License
44 stars 37 forks source link

Fix bug and Improve error handling in Figures tasks and pipeline #312

Closed johnbaldwin closed 3 years ago

johnbaldwin commented 3 years ago
  1. Fixed the bug, poorly placed parentheses within exception handling in the new code

  2. Add pipeline exception handling - course daily metrics

The pipeline function, bulk_calculate_course_progress_data, does a lot of work and a potential point of failure to fail all the metrics for the course for the day on collecting just one metric.

So this commit traps for exceptions when the function "bulk_calculate_course_progress_data" is called and sets the course daily metrics 'average_progress' to None if it fails. Being 'None' helps identify pipeline erors rather than setting progress to zero.

Added test to make sure we are logging when it fails

  1. Add figures.tasks exception handling cdm and enrollment data Added exception handling and logging to populate_single_cdm, the call to update_enrollment_data in 'populate_daily_metrics' and exception handling for each site so that one site does not fail the remaining sites in the chain

https://appsembler.atlassian.net/browse/RED-1709

johnbaldwin commented 3 years ago

Thanks @thraxil !

johnbaldwin commented 3 years ago

Tox passed locally, force merging. Maybe I regret it. We'll see