-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix order #4087
Fix order #4087
Conversation
Could you check these lines? If the results are in the reversed order, it looks like the |
self.db_task = models.Task.objects.prefetch_related("data__images").get(id=pk) | ||
self.db_task = models.Task.objects.prefetch_related( | ||
Prefetch('data__images', queryset=models.Image.objects.order_by('frame')) | ||
).get(id=pk) | ||
|
||
# Postgres doesn't guarantee an order by default without explicit order_by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this comment also applies to the current fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I'm the right person to review questions related to CVAT DB use, but for me the current fix looks more or less valid. If you see how we can enforce annotation ordering independently of DB requests, I'd prefer such solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Motivation and context
Resolve #4025
How has this been tested?
Manually
Checklist
develop
branch- [ ] I have updated the documentation accordingly- [ ] I have added tests to cover my changes- [ ] I have increased versions of npm packages if it is necessary (cvat-canvas,cvat-core, cvat-data and cvat-ui)
License
Feel free to contact the maintainers if that's a concern.