Skip to content

Commit 2a97709

Browse files
Merge pull request #1969 from kili-technology/lab-3898-annotation
chore(LAB-3898): remove deprecated annotation fields
2 parents 023f884 + 531d921 commit 2a97709

File tree

5 files changed

+0
-72
lines changed

5 files changed

+0
-72
lines changed

src/kili/adapters/kili_api_gateway/label/common.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ def get_annotation_fragment():
4242
classification_annotation_fragment=fragment_builder(
4343
("annotationValue.categories", "chatItemId")
4444
),
45-
ranking_annotation_fragment=fragment_builder(
46-
(
47-
"annotationValue.orders.elements",
48-
"annotationValue.orders.rank",
49-
)
50-
),
5145
comparison_annotation_fragment=fragment_builder(
5246
(
5347
"annotationValue.choice.code",

src/kili/adapters/kili_api_gateway/label/operations.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ def get_append_to_labels_mutation(fragment: str) -> str:
7474
def get_annotations_partial_query(
7575
annotation_fragment: str,
7676
classification_annotation_fragment: str,
77-
ranking_annotation_fragment: str,
7877
comparison_annotation_fragment: str,
7978
transcription_annotation_fragment: str,
8079
video_annotation_fragment: str,
@@ -93,13 +92,6 @@ def get_annotations_partial_query(
9392
}}
9493
"""
9594

96-
if ranking_annotation_fragment.strip():
97-
inline_fragments += f"""
98-
... on RankingAnnotation {{
99-
{ranking_annotation_fragment}
100-
}}
101-
"""
102-
10395
if comparison_annotation_fragment.strip():
10496
inline_fragments += f"""
10597
... on ComparisonAnnotation {{

src/kili/domain/annotation.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,6 @@ class RankingOrderValue(TypedDict):
4848
elements: List[str]
4949

5050

51-
class RankingAnnotationValue(TypedDict):
52-
"""Ranking annotation value."""
53-
54-
orders: List[RankingOrderValue]
55-
56-
57-
class RankingAnnotation(TypedDict):
58-
"""Ranking annotation."""
59-
60-
# pylint: disable=unused-private-member
61-
__typename: Literal["RankingAnnotation"]
62-
id: AnnotationId
63-
labelId: LabelId
64-
job: JobName
65-
path: List[List[str]]
66-
annotationValue: RankingAnnotationValue
67-
68-
6951
class TranscriptionAnnotationValue(TypedDict):
7052
"""Transcription annotation value."""
7153

@@ -190,13 +172,11 @@ class VideoTranscriptionAnnotation(TypedDict):
190172
ClassicAnnotation = Union[
191173
ClassificationAnnotation,
192174
ObjectDetectionAnnotation,
193-
RankingAnnotation,
194175
TranscriptionAnnotation,
195176
]
196177

197178
Annotation = Union[
198179
ClassificationAnnotation,
199-
RankingAnnotation,
200180
TranscriptionAnnotation,
201181
VideoAnnotation,
202182
]

tests/unit/adapters/kili_api_gateway/label/test_data/test_case_14.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@
1313
"required": 0,
1414
"isChild": False,
1515
},
16-
"RANKING_JOB": {
17-
"content": {"input": "select"},
18-
"instruction": "Ranking Select",
19-
"mlTask": "RANKING",
20-
"required": 0,
21-
"isChild": False,
22-
},
2316
"TRANSCRIPTION_JOB": {
2417
"content": {"input": "textField"},
2518
"instruction": "Transcription Text",
@@ -31,23 +24,6 @@
3124
}
3225

3326
annotations = [
34-
{
35-
"id": "4eb1c8e2-05fd-42ae-aa17-7c18a803c682",
36-
"job": "RANKING_JOB",
37-
"path": [],
38-
"labelId": "clr53q1as0208kjba8jwcavcx",
39-
"annotationValue": {
40-
"id": "4eb1c8e2-05fd-42ae-aa17-7c18a803c682",
41-
"isPrediction": False,
42-
"orders": [
43-
{"elements": ["Response 5"], "rank": 1, "__typename": "RankingOrderValue"},
44-
{"elements": ["Response 3"], "rank": 3, "__typename": "RankingOrderValue"},
45-
{"elements": ["Response 2"], "rank": 2, "__typename": "RankingOrderValue"},
46-
],
47-
"__typename": "RankingAnnotationValue",
48-
},
49-
"__typename": "RankingAnnotation",
50-
},
5127
{
5228
"id": "8be13b44-dfb5-4456-83b4-710b902f2fa3",
5329
"job": "CLASSIFICATION_JOB",
@@ -118,13 +94,6 @@
11894

11995

12096
expected_json_resp = {
121-
"RANKING_JOB": {
122-
"orders": [
123-
{"elements": ["Response 5"], "rank": 1, "__typename": "RankingOrderValue"},
124-
{"elements": ["Response 2"], "rank": 2, "__typename": "RankingOrderValue"},
125-
{"elements": ["Response 3"], "rank": 3, "__typename": "RankingOrderValue"},
126-
]
127-
},
12897
"CLASSIFICATION_JOB": {"categories": [{"name": "Choice 1"}]},
12998
"TRANSCRIPTION_JOB": {"text": "Test Transcription"},
13099
}

tests/unit/services/export/expected/llm_project_assets.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,6 @@
2424
"isSentBackToQueue": False,
2525
"jsonResponse": {
2626
"CLASSIFICATION_JOB": {"categories": [{"name": "Choice 1"}]},
27-
"RANKING_JOB": {
28-
"orders": [
29-
{"__typename": "RankingOrderValue", "elements": ["Response 5"], "rank": 1},
30-
{"__typename": "RankingOrderValue", "elements": ["Response 2"], "rank": 2},
31-
{"__typename": "RankingOrderValue", "elements": ["Response 3"], "rank": 3},
32-
]
33-
},
3427
"TRANSCRIPTION_JOB": {"text": "Test Transcription"},
3528
},
3629
"labelType": "DEFAULT",

0 commit comments

Comments
 (0)