-
Notifications
You must be signed in to change notification settings - Fork 2.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: RND-98: correct response schema for tasks.get() #6012
Conversation
✅ Deploy Preview for heartex-docs canceled.
|
✅ Deploy Preview for label-studio-docs-new-theme canceled.
|
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.
Tests are failed in LS and LSE
annotators = serializers.SerializerMethodField(required=False, read_only=True) | ||
predictions = PredictionSerializer(required=False, many=True, default=[], read_only=True) | ||
annotations = AnnotationsDMFieldSerializer(required=False, many=True, default=[], read_only=True) | ||
drafts = AnnotationDraftDMFieldSerializer(required=False, many=True, default=[], read_only=True) |
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 will break the call of DataManagerTaskSerializer::get_drafts()
+ LseTaskSerializer::get_drafts()
some-2024-06-19_00.20.54.mp4
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.
Fixed for predictions
and drafts
- schemas were rewritten manually on top of serializers.SerializerMethodField
drafts = serializers.SerializerMethodField(required=False, read_only=True) | ||
annotators = serializers.SerializerMethodField(required=False, read_only=True) | ||
predictions = PredictionSerializer(required=False, many=True, default=[], read_only=True) | ||
annotations = AnnotationsDMFieldSerializer(required=False, many=True, default=[], read_only=True) |
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 might affect the calls of LseTaskSerializer::get_annotations()
and LseTaskSerializerForAnnotators::get_annotations()
from LSE
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.
predictions = PredictionSerializer(required=False, many=True, default=[], read_only=True) | ||
annotations = AnnotationsDMFieldSerializer(required=False, many=True, default=[], read_only=True) | ||
drafts = AnnotationDraftDMFieldSerializer(required=False, many=True, default=[], read_only=True) | ||
annotators = AnnotatorsDMField(required=False, read_only=True) |
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.
the same problem as with get_drafts()
+ LseTaskSerializer::get_annotators()
@@ -222,7 +270,7 @@ class DataManagerTaskSerializer(TaskSerializer): | |||
predictions_model_versions = serializers.SerializerMethodField(required=False) | |||
avg_lead_time = serializers.FloatField(required=False) | |||
draft_exists = serializers.BooleanField(required=False) | |||
updated_by = serializers.SerializerMethodField(required=False, read_only=True) | |||
updated_by = UpdatedByDMField(required=False, read_only=True) |
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.
the same problem as with get_drafts()
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.
Are you sure the problem does appear for this field as well? As it is just as shallow override over serializers.SerializerMethodField
@@ -34,8 +34,8 @@ | |||
'comment_count': 0, | |||
'unresolved_comment_count': 0, | |||
'last_comment_updated_at': '2024-01-15T09:30:00Z', |
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 believe it should be like this:
2024-06-18T23:45:46.048490Z
pls, fix created_at
and updated_at
too.
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.
Or maybe it's better to use the full version of api/tasks response:
{
"id": 13,
"predictions": [],
"annotations": [],
"drafts": [],
"annotators": [],
"inner_id": 2,
"cancelled_annotations": 0,
"total_annotations": 0,
"total_predictions": 0,
"completed_at": null,
"annotations_results": "",
"predictions_results": "",
"predictions_score": null,
"file_upload": "6b25fc23-some_3.mp4",
"storage_filename": null,
"annotations_ids": "",
"predictions_model_versions": "",
"avg_lead_time": null,
"draft_exists": false,
"updated_by": [],
"data": {
"image": "/data/upload/1/6b25fc23-some_3.mp4"
},
"meta": {},
"created_at": "2024-06-18T23:45:46.048490Z",
"updated_at": "2024-06-18T23:45:46.048538Z",
"is_labeled": false,
"overlap": 1,
"comment_count": 0,
"unresolved_comment_count": 0,
"last_comment_updated_at": null,
"project": 1,
"comment_authors": []
}
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.
Fixed
Hi @niklub! This PR was [created](https://github.com/HumanSignal/label-studio/actions/runs/9580652200) in a response to PRs in upstream repos: - HumanSignal/label-studio-sdk#252 --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: bmartel <brandonmartel@gmail.com> Co-authored-by: robot-ci-heartex <robot-ci-heartex@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: niklub <nikolai@heartex.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #6012 +/- ##
===========================================
+ Coverage 76.71% 76.76% +0.05%
===========================================
Files 168 168
Lines 13582 13602 +20
===========================================
+ Hits 10419 10442 +23
+ Misses 3163 3160 -3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
/git merge develop
|
Calling
tasks.get()
returns error due to incorrect Task schema