Skip to content

Commit

Permalink
refactor: OPTIC-919: Remove Stale Feature Flag - fflag_fix_back_LSDV_…
Browse files Browse the repository at this point in the history
…4748_annotate_task_number_14032023_short (#6700)
  • Loading branch information
luarmr authored Nov 22, 2024
1 parent 26328a1 commit bdc505c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
1 change: 0 additions & 1 deletion label_studio/core/feature_flags/stale_feature_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
'fflag_fix_back_lsdv_4929_limit_exports_10042023_short': True,
'fflag_feat_front_lsdv_4620_richtext_opimization_060423_short': True,
'fflag_feat_front_lsdv_4661_full_uri_resolve_15032023_short': True,
'fflag_fix_back_LSDV_4748_annotate_task_number_14032023_short': True,
'fflag_feat_front_lsdv_4659_skipduplicates_060323_short': True,
'fflag_fix_font_lsdv_1148_hotkeys_namespaces_01022023_short': True,
'fflag_fix_back_lsdv_1044_check_annotations_24012023_short': False,
Expand Down
14 changes: 4 additions & 10 deletions label_studio/projects/functions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,13 @@


def annotate_task_number(queryset):
if flag_set('fflag_fix_back_LSDV_4748_annotate_task_number_14032023_short', user='auto'):
tasks = Task.objects.filter(project=OuterRef('id')).values_list('id')
return queryset.annotate(task_number=SQCount(tasks))
else:
return queryset.annotate(task_number=Count('tasks', distinct=True))
tasks = Task.objects.filter(project=OuterRef('id')).values_list('id')
return queryset.annotate(task_number=SQCount(tasks))


def annotate_finished_task_number(queryset):
if flag_set('fflag_fix_back_LSDV_4748_annotate_task_number_14032023_short', user='auto'):
tasks = Task.objects.filter(project=OuterRef('id'), is_labeled=True).values_list('id')
return queryset.annotate(finished_task_number=SQCount(tasks))
else:
return queryset.annotate(finished_task_number=Count('tasks', distinct=True, filter=Q(tasks__is_labeled=True)))
tasks = Task.objects.filter(project=OuterRef('id'), is_labeled=True).values_list('id')
return queryset.annotate(finished_task_number=SQCount(tasks))


def annotate_total_predictions_number(queryset):
Expand Down

0 comments on commit bdc505c

Please sign in to comment.