update django_bulk_update with inbuilt bulk_update#4417
Merged
bjester merged 5 commits intolearningequality:unstablefrom Feb 2, 2024
Merged
update django_bulk_update with inbuilt bulk_update#4417bjester merged 5 commits intolearningequality:unstablefrom
bjester merged 5 commits intolearningequality:unstablefrom
Conversation
Contributor
Author
|
@rtibbles Could you take a look at the PR? |
bjester
requested changes
Jan 26, 2024
Member
bjester
left a comment
There was a problem hiding this comment.
When I add or edit assessment items, or otherwise known as 'Exercises' in the UI, I see this error in my logs:
[2024-01-26 23:06:26,135: ERROR/ForkPoolWorker-1] Field names must be given to bulk_update().
Traceback (most recent call last):
File "/home/bjester/Projects/learningequality/studio2/contentcuration/contentcuration/viewsets/base.py", line 863, in update_from_changes
self.perform_bulk_update(serializer)
File "/home/bjester/Projects/learningequality/studio2/contentcuration/contentcuration/viewsets/base.py", line 850, in perform_bulk_update
serializer.save()
File "/home/bjester/Projects/learningequality/studio2/contentcuration/contentcuration/viewsets/base.py", line 363, in save
instance = super(BulkListSerializer, self).save(**kwargs)
File "/home/bjester/Projects/learningequality/pyenv/versions/3.9.13/envs/studio-3.9.13/lib/python3.9/site-packages/rest_framework/serializers.py", line 703, in save
self.instance = self.update(self.instance, validated_data)
File "/home/bjester/Projects/learningequality/studio2/contentcuration/contentcuration/viewsets/assessmentitem.py", line 70, in update
all_objects = super(AssessmentListSerializer, self).update(
File "/home/bjester/Projects/learningequality/studio2/contentcuration/contentcuration/viewsets/base.py", line 325, in update
self.child.Meta.model.objects.bulk_update(updated_objects, list(properties_to_update))
File "/home/bjester/Projects/learningequality/pyenv/versions/3.9.13/envs/studio-3.9.13/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/home/bjester/Projects/learningequality/pyenv/versions/3.9.13/envs/studio-3.9.13/lib/python3.9/site-packages/django/db/models/query.py", line 534, in bulk_update
raise ValueError('Field names must be given to bulk_update().')
ValueError: Field names must be given to bulk_update().
``
Contributor
Author
|
@bjester I'm working on a few changes, please wait before reviewing it. I'll let you know when the changes are ready. |
Contributor
Author
|
@bjester could you check the PR out? |
bjester
requested changes
Jan 31, 2024
bjester
approved these changes
Feb 2, 2024
Member
bjester
left a comment
There was a problem hiding this comment.
Looks good! Thanks @FidalMathew !
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Description of the change(s) you made
I have remove django_bulk_update function in 2 files:
Manual verification steps performed
Screenshots (if applicable)
Does this introduce any tech-debt items?
Reviewer guidance
How can a reviewer test these changes?
Are there any risky areas that deserve extra testing?
References
Comments
Contributor's Checklist
PR process:
CHANGELOGlabel been added to this PR. Note: items with this label will be added to the CHANGELOG at a later timedocslabel has been added if this introduces a change that needs to be updated in the user docs?requirements.txtfiles also included in this PRStudio-specifc:
notranslateclass been added to elements that shouldn't be translated by Google Chrome's automatic translation feature (e.g. icons, user-generated text)pages,components, andlayoutsdirectories as described in the docsTesting:
Reviewer's Checklist
This section is for reviewers to fill out.
yarnandpip)