Skip to content
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

Bugfix/Fix multiple display of completed items #194



Copy link

@c-w c-w commented May 13, 2019

As discussed in #172, there is an issue in the completed filter where each document is included once per annotation in the document. See screenshot below for an example where a document is included 4 times in the list:

Screenshot showing completed filter before fix

The root cause of the problem is that the current filtering approach with {column_name}__isnull generates an inner join between the documents and annotations table which leads to the behavior of having one copy of the document per annotation.

This change fixes the behavior and ensures that each document is only included once in the completed list by using an explicit group by and count filter on the number of annotations:

Screenshot showing completed filter after fix

Ideally we'd use queryset.distinct('id') instead of the group by count approach, but unfortunately this is currently only supported by Postgres.

Resolves #172

@Hironsan Hironsan merged commit d5de748 into doccano:master May 15, 2019
2 checks passed
@c-w c-w deleted the bugfix/completed-samples-are-duplicated branch May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

2 participants