Skip to content

Separate out different categories of incomplete.#2800

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

Separate out different categories of incomplete.#2800
rtibbles merged 7 commits intolearningequality: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

Copy link
Copy Markdown
Contributor

@jayoshih jayoshih left a comment

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 thread contentcuration/contentcuration/management/commands/mark_incomplete.py Outdated
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 15, 2021

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 Files Coverage Δ
contentcuration/contentcuration/decorators.py 56.60% <50.00%> (-37.60%) ⬇️
contentcuration/contentcuration/forms.py 69.06% <72.41%> (+20.61%) ⬆️
...ntentcuration/contentcuration/db/models/manager.py 93.49% <93.33%> (-6.51%) ⬇️
contentcuration/contentcuration/api.py 92.06% <100.00%> (+1.43%) ⬆️
...tentcuration/contentcuration/context_processors.py 100.00% <100.00%> (ø)
...tcuration/contentcuration/db/models/expressions.py 93.33% <100.00%> (-6.67%) ⬇️
...entcuration/contentcuration/db/models/functions.py 100.00% <100.00%> (ø)
...ation/contentcuration/tests/test_rest_framework.py 36.93% <0.00%> (-63.07%) ⬇️
contentcuration/contentcuration/utils/format.py 21.05% <0.00%> (-49.54%) ⬇️
contentcuration/contentcuration/utils/cache.py 31.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 thread contentcuration/contentcuration/management/commands/mark_incomplete.py Outdated
Comment thread contentcuration/contentcuration/management/commands/mark_incomplete.py Outdated
Copy link
Copy Markdown
Member

@bjester bjester left a comment

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:hotfixes Jan 15, 2021
@rtibbles rtibbles deleted the mark_incomplete branch January 15, 2021 22:55
Sign up for free to 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