Resolve "Add task for checking plausibility of data" #482

Merged
hansegucker merged 30 commits from 91-add-task-for-checking-plausibility-of-data into master 2021-01-08 13:01:14 +01:00
Owner

Closes #91

Closes #91
Author
Owner

added 1 commit

  • 07106d1b - Init data check system and add first check for personal notes

Compare with previous version

added 1 commit <ul><li>07106d1b - Init data check system and add first check for personal notes</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=3353&start_sha=5833dfa2893c0e63b1b35ebe27b580409c29dc90)
Author
Owner

added 1 commit

  • 60b52a14 - Move data check to own (optional) celery task

Compare with previous version

added 1 commit <ul><li>60b52a14 - Move data check to own (optional) celery task</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=3354&start_sha=07106d1b0819a8fcd8fd6cd4c69c657b33054282)
Author
Owner

added 3 commits

  • 7e9c9b66 - Add missing migration
  • 52883be8 - Send emails to notify about data problems
  • d49f14ee - Merge remote-tracking branch...

Compare with previous version

added 3 commits <ul><li>7e9c9b66 - Add missing migration</li><li>52883be8 - Send emails to notify about data problems</li><li>d49f14ee - Merge remote-tracking branch...</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=3355&start_sha=60b52a141231ab13845b9895095da1eca50be665)
Author
Owner

added 1 commit

  • b34fad00 - Update menu representation for data checks

Compare with previous version

added 1 commit <ul><li>b34fad00 - Update menu representation for data checks</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=3356&start_sha=d49f14eef895a9a4fb3de8a1e50e650edc30dc2e)
Owner

Maybe you also can add a custom health check to the system status page.

https://github.com/KristianOellegaard/django-health-check#writing-a-custom-health-check

Maybe you also can add a custom health check to the system status page. https://github.com/KristianOellegaard/django-health-check#writing-a-custom-health-check
Owner

Please evaluate django-datawatch.

Please evaluate django-datawatch.
Owner
https://lmgtfy.com/?q=python+docstring
Owner

Please use class-based views.

Please use class-based views.
Author
Owner

added 196 commits

  • b34fad00...4a91b607 - 195 commits from branch master
  • 6f41b16b - Merge branch 'master' into 91-add-task-for-checking-plausibility-of-data

Compare with previous version

added 196 commits <ul><li>b34fad00...4a91b607 - 195 commits from branch <code>master</code></li><li>6f41b16b - Merge branch &#39;master&#39; into 91-add-task-for-checking-plausibility-of-data</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=3744&start_sha=b34fad00dff324ffea6efdc3f75bfb38a89ecfbb)
Author
Owner

changed this line in version 6 of the diff

changed this line in [version 6 of the diff](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=3763&start_sha=6f41b16bd6b9977e208cf7ac67d55853d34cebcb#15793436ffa21b8e1a3c3610e43f80aed3c1d7a8_15_9)
Author
Owner

changed this line in version 6 of the diff

changed this line in [version 6 of the diff](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=3763&start_sha=6f41b16bd6b9977e208cf7ac67d55853d34cebcb#17fa7705c025f0876e0fe2c72d23ddad96fcf6f2_854_842)
Author
Owner

added 1 commit

  • 27413aff - Move base data check system to core

Compare with previous version

added 1 commit <ul><li>27413aff - Move base data check system to core</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=3763&start_sha=6f41b16bd6b9977e208cf7ac67d55853d34cebcb)
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>2df54418 - Also move template to core</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=3765&start_sha=27413affba971d674171477d0439cfbccf9b04c8)
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>9838f025 - Fix imports in data checks</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=3768&start_sha=2df544180e0aa733289df6dbc3cd61bebeffbfe3)
Author
Owner

Blocked by AlekSIS/official/AlekSIS-Core!779

Blocked by AlekSIS/official/AlekSIS-Core!779
Author
Owner

added 1 commit

  • e8129856 - Move email templates and preferences for data checks to core

Compare with previous version

added 1 commit <ul><li>e8129856 - Move email templates and preferences for data checks to core</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=3772&start_sha=9838f025bfbb166378d1d4d0d4980695dadf86c0)
Author
Owner

added 18 commits

  • e8129856...405aa743 - 15 commits from branch master
  • e1a7b126 - Write data check NoGroupsOfPersonsSetInPersonalNotesDataCheck
  • 9e0323c2 - Merge branch 'master' into 91-add-task-for-checking-plausibility-of-data
  • ebff52ea - Reformat

Compare with previous version

added 18 commits <ul><li>e8129856...405aa743 - 15 commits from branch <code>master</code></li><li>e1a7b126 - Write data check NoGroupsOfPersonsSetInPersonalNotesDataCheck</li><li>9e0323c2 - Merge branch &#39;master&#39; into 91-add-task-for-checking-plausibility-of-data</li><li>ebff52ea - Reformat</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=3870&start_sha=e8129856046318952640567342e9bc0d66cfc816)
Author
Owner

added 1 commit

  • ba6eeed0 - Add data check for lesson documentations on holidays

Compare with previous version

added 1 commit <ul><li>ba6eeed0 - Add data check for lesson documentations on holidays</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=3876&start_sha=ebff52ea7c2b8bf0ead9f7aeea4e892be68bcb8c)
Author
Owner

Maybe someone find a more efficient way to do this stuff.

Maybe someone find a more efficient way to do this stuff.
Author
Owner

added 5 commits

  • ba6eeed0...abfdb175 - 3 commits from branch master
  • 0d16d3cb - Merge branch 'master' into 91-add-task-for-checking-plausibility-of-data
  • 7606d5e2 - Fix lint issues

Compare with previous version

added 5 commits <ul><li>ba6eeed0...abfdb175 - 3 commits from branch <code>master</code></li><li>0d16d3cb - Merge branch &#39;master&#39; into 91-add-task-for-checking-plausibility-of-data</li><li>7606d5e2 - Fix lint issues</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=3886&start_sha=ba6eeed01a92de66250804e0d9a9c1703d4c9c61)
Author
Owner

added 2 commits

  • 3cc04ff9 - 1 commit from branch master
  • fa968769 - Merge branch 'master' into 91-add-task-for-checking-plausibility-of-data

Compare with previous version

added 2 commits <ul><li>3cc04ff9 - 1 commit from branch <code>master</code></li><li>fa968769 - Merge branch &#39;master&#39; into 91-add-task-for-checking-plausibility-of-data</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=3887&start_sha=7606d5e22059c9bbd74e3e5399f2f2c37004cd64)
Author
Owner

added 6 commits

  • fa968769...5fb87b07 - 5 commits from branch master
  • 335b5027 - Merge branch 'master' into 91-add-task-for-checking-plausibility-of-data

Compare with previous version

added 6 commits <ul><li>fa968769...5fb87b07 - 5 commits from branch <code>master</code></li><li>335b5027 - Merge branch &#39;master&#39; into 91-add-task-for-checking-plausibility-of-data</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=3973&start_sha=fa968769584904ec1f96cf670c28734763591911)
Author
Owner

added 14 commits

  • 335b5027...053be75f - 13 commits from branch master
  • 469bbd80 - Merge branch 'master' into 91-add-task-for-checking-plausibility-of-data

Compare with previous version

added 14 commits <ul><li>335b5027...053be75f - 13 commits from branch <code>master</code></li><li>469bbd80 - Merge branch &#39;master&#39; into 91-add-task-for-checking-plausibility-of-data</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=4075&start_sha=335b5027d05ff4a41563133d38cd4d1efcff9cda)
Author
Owner

added 1 commit

  • 25067f6e - Add check for personal notes on holidays

Compare with previous version

added 1 commit <ul><li>25067f6e - Add check for personal notes on holidays</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=4076&start_sha=469bbd80adce1c311fde51246c5f9624667ad8c6)
Author
Owner

added 3 commits

  • b2f2c7d2 - Add data check to ensure that there are no excuses without absences
  • f42357a6 - Remove superfluous query from data checks
  • 3c99004a - Add missing reset solve option for data checks

Compare with previous version

added 3 commits <ul><li>b2f2c7d2 - Add data check to ensure that there are no excuses without absences</li><li>f42357a6 - Remove superfluous query from data checks</li><li>3c99004a - Add missing reset solve option for data checks</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=4079&start_sha=25067f6e13ffd74ef6bdf328fad7cd762bfe977e)
Author
Owner

changed this line in version 18 of the diff

changed this line in [version 18 of the diff](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=4082&start_sha=3c99004ae87a9f5b6a3f1eba6627fc1293de7dab#15793436ffa21b8e1a3c3610e43f80aed3c1d7a8_142_126)
Author
Owner

added 1 commit

  • bd0ae76f - Simplify registering of data check results by adding a dedicated method

Compare with previous version

added 1 commit <ul><li>bd0ae76f - Simplify registering of data check results by adding a dedicated method</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=4082&start_sha=3c99004ae87a9f5b6a3f1eba6627fc1293de7dab)
Author
Owner

added 1 commit

Compare with previous version

added 1 commit <ul><li>d1d30c65 - Fix lint</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=4084&start_sha=bd0ae76f7562554782363e856de10afd3c8ba5a0)
Author
Owner

assigned to @nik

assigned to @nik
Author
Owner

requested review from @debdolph

requested review from @debdolph
Author
Owner

removed review request for @debdolph

removed review request for @debdolph
Author
Owner

marked this merge request as ready

marked this merge request as **ready**
Author
Owner

@nik Any idea?

@nik Any idea?
Author
Owner

added 1 commit

  • 96c09d5a - Load data checks from related models instead of using a custom registry

Compare with previous version

added 1 commit <ul><li>96c09d5a - Load data checks from related models instead of using a custom registry</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=4106&start_sha=d1d30c65fece69393529fa573831a11e3d7c208d)
Owner

What we basically want is something like this SQL:

select doc.* from doc, holidays where holidays.start <= to_date(concat('2020', week), 'IYYYIWW') + weekday - 1 and to_date(concat('2020', week), 'IYYYIWW') + weekday - 1 <= holidays."end";

I got as far as translating the date conversion:

weekday_to_date = Func(Concat("2020", F("week")), "IYYYIW", function="TO_DATE") + F("weekday") - Value(1

Now, how do we do a JOIN without a foreign key relation in Django?

If only we had SQLAlchemy ☹

What we basically want is something like this SQL: ```sql select doc.* from doc, holidays where holidays.start <= to_date(concat('2020', week), 'IYYYIWW') + weekday - 1 and to_date(concat('2020', week), 'IYYYIWW') + weekday - 1 <= holidays."end"; ``` I got as far as translating the date conversion: ```python weekday_to_date = Func(Concat("2020", F("week")), "IYYYIW", function="TO_DATE") + F("weekday") - Value(1 ``` Now, how do we do a `JOIN` without a foreign key relation in Django? If only we had SQLAlchemy ☹
Owner

In any case, this field expression up there might be (part of) the solution for AlekSIS-App-Chronos#81

In any case, this field expression up there might be (part of) the solution for AlekSIS-App-Chronos#81
Author
Owner

The actual working variant 😉 :

weekday_to_date = ExpressionWrapper(Func(Concat(F("year"), F("week")), Value("IYYYIW"), output_field=DateField(), function="TO_DATE") + F("lesson_period__period__weekday"), output_field=DateField())
The actual working variant :wink: : ```python weekday_to_date = ExpressionWrapper(Func(Concat(F("year"), F("week")), Value("IYYYIW"), output_field=DateField(), function="TO_DATE") + F("lesson_period__period__weekday"), output_field=DateField()) ```
Author
Owner

resolved all threads

resolved all threads
Author
Owner

added 1 commit

  • e208d546 - Make holiday data checks much more efficient by using SQL functions

Compare with previous version

added 1 commit <ul><li>e208d546 - Make holiday data checks much more efficient by using SQL functions</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=4160&start_sha=96c09d5a495f425ddee08fcab52120761684c681)
Author
Owner

added 5 commits

  • e208d546...7990af6c - 4 commits from branch master
  • eeb5f521 - Merge branch 'master' into 91-add-task-for-checking-plausibility-of-data

Compare with previous version

added 5 commits <ul><li>e208d546...7990af6c - 4 commits from branch <code>master</code></li><li>eeb5f521 - Merge branch &#39;master&#39; into 91-add-task-for-checking-plausibility-of-data</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=4162&start_sha=e208d5469ebd4b9ce3f2f6d3d3d34cb117dfc9a4)
Owner

This should not be a nested loop. Build a query containing all holiday dates and then check them all in one batch.

This should not be a nested loop. Build a query containing all holiday dates and then check them all in one batch.
Author
Owner

changed this line in version 23 of the diff

changed this line in [version 23 of the diff](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=4176&start_sha=eeb5f5214274ab292ca0c60753fecbab67d2619e#15793436ffa21b8e1a3c3610e43f80aed3c1d7a8_130_128)
Author
Owner

added 1 commit

  • 1b44092a - [Data checks] Combine holiday queries to one big query

Compare with previous version

added 1 commit <ul><li>1b44092a - [Data checks] Combine holiday queries to one big query</li></ul> [Compare with previous version](/AlekSIS/official/AlekSIS-App-Alsijil/-/merge_requests/92/diffs?diff_id=4176&start_sha=eeb5f5214274ab292ca0c60753fecbab67d2619e)
Author
Owner

resolved all threads

resolved all threads
Owner

mentioned in commit 891584bf92

mentioned in commit 891584bf92f9b856cae0cd03f548b6b59c35bd54
nik merged commit 891584bf92 into master 2021-01-08 13:01:14 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
aleksis/AlekSIS-App-Alsijil!482
No description provided.