Skip to content

Separate out different categories of incomplete. - #2800

Merged
rtibbles merged 7 commits into
learningequality:hotfixesfrom
rtibbles:mark_incomplete
Jan 15, 2021
Merged

Separate out different categories of incomplete.#2800
rtibbles merged 7 commits into
learningequality:hotfixesfrom
rtibbles:mark_incomplete

Conversation

@rtibbles

Copy link
Copy Markdown
Member

Description

Makes updates to the mark incomplete command to separate out different checks
Adds order_bys liberally to reduce scanning

@jayoshihjayoshih left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few optimizations that might help speed things up

# Mark invalid licenses
licensestart = time.time()
logging.info('Marking blank licenses...')
count = ContentNode.objects.exclude(kind_id=content_kinds.TOPIC).filter(license__isnull=True).order_by().update(complete=False)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since some might have both the title and license problem, could you use filter(complete=False) here and in other queries?

Comment threadcontentcuration/contentcuration/management/commands/mark_incomplete.py Outdated
@codecov

codecovBot commented Jan 15, 2021

Copy link
Copy Markdown

Codecov Report

Merging #2800 (b670bf7) into hotfixes (28587f8) will increase coverage by 4.01%.
The diff coverage is 88.73%.

Impacted file tree graph

@@ Coverage Diff @@## hotfixes #2800 +/- ##
============================================
+ Coverage 80.80% 84.81% +4.01% 
============================================
Files 281 292 +11 Lines 12659 15298 +2639 ============================================
+ Hits 10229 12975 +2746 + Misses 2430 2323 -107 
Impacted FilesCoverage Δ
contentcuration/contentcuration/decorators.py56.60% <50.00%> (-37.60%)⬇️
contentcuration/contentcuration/forms.py69.06% <72.41%> (+20.61%)⬆️
...ntentcuration/contentcuration/db/models/manager.py93.49% <93.33%> (-6.51%)⬇️
contentcuration/contentcuration/api.py92.06% <100.00%> (+1.43%)⬆️
...tentcuration/contentcuration/context_processors.py100.00% <100.00%> (ø)
...tcuration/contentcuration/db/models/expressions.py93.33% <100.00%> (-6.67%)⬇️
...entcuration/contentcuration/db/models/functions.py100.00% <100.00%> (ø)
...ation/contentcuration/tests/test_rest_framework.py36.93% <0.00%> (-63.07%)⬇️
contentcuration/contentcuration/utils/format.py21.05% <0.00%> (-49.54%)⬇️
contentcuration/contentcuration/utils/cache.py31.70% <0.00%> (-31.93%)⬇️
... and 173 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 12ca6fc...b670bf7. Read the comment docs.

Comment threadcontentcuration/contentcuration/management/commands/mark_incomplete.py Outdated
Comment threadcontentcuration/contentcuration/management/commands/mark_incomplete.py Outdated

@bjesterbjester left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would suggest making the join type change, just in case, but looks good!

@jayoshih
jayoshih self-requested a review January 15, 2021 22:09
@rtibbles
rtibbles merged commit 6d773c1 into learningequality:hotfixesJan 15, 2021
@rtibbles
rtibbles deleted the mark_incomplete branch January 15, 2021 22:55
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@rtibbles@bjester@jayoshih