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

Improve verify_course_ids to only consider courses with local data #1327

Closed
jonespm opened this issue Sep 24, 2021 · 5 comments · Fixed by #1424
Closed

Improve verify_course_ids to only consider courses with local data #1327

jonespm opened this issue Sep 24, 2021 · 5 comments · Fixed by #1424

Comments

@jonespm
Copy link
Member

jonespm commented Sep 24, 2021

When validating the courses, we should also check to see if the courses have any data in other tables because we consider it invalid.

There are cases where a course is too new and we haven't even pulled down data for it yet.

I think for an easier solution we could also just check the data_last_updated column and check to see if that has a value. It would still be an "invalid course" but one that can just be skipped if it was never processed and has no data.

This method is intended to protect removing data in the case that the data warehouse has a problem.

def verify_course_ids(self):

@ssciolla
Copy link
Contributor

I remembered this other issue that is related, but with some data model changes and LTI, the picture has certainly changed a bit now: #383

@jonespm
Copy link
Member Author

jonespm commented Sep 6, 2022

To test this

  • Launch the course from an actual course that would have data in the database
  • Either launch it from a brand new course that doesn't yet have data, or just manually add a Course directly to the admin with an invalid id (like 999999999)
  • Try to run the cron. It should only process the valid course and the last updated value on the other course shouldn't have been updated.

jonespm added a commit to jonespm/student-dashboard-django that referenced this issue Sep 6, 2022
MyLA-2022.02.01 automation moved this from In progress to Review/QA Sep 9, 2022
jonespm added a commit that referenced this issue Sep 9, 2022
… local data (#1424)

* Fixes #1327 - Improve verify_course_ids to only consider courses with
local data

* Update dashboard/cron.py

* Simplifying the queries to return a specific shape

* Removing unneeded extra quotes
@jennlove-um
Copy link
Contributor

Tested in beta:

  1. Course that has data in the UDW: Data added and last updated date updated.
  2. Course that does not have data in UDW: No data, no error, and last updated date is still null.

Testing passes in beta.

@jennlove-um
Copy link
Contributor

Tested in beta:

  1. Course that has data in the UDW: Data added and last updated date updated.
  2. Course that does not have data in UDW: No data, no error, and last updated date is still null.

@jennlove-um jennlove-um moved this from Review/QA to Done in MyLA-2022.02.01 Dec 15, 2022
@jennlove-um
Copy link
Contributor

Tested in beta:

Course that has data in the UDW: Data added and last updated date updated.
Course that does not have data in UDW: No data, no error, and last updated date is still null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
3 participants