From 087b84be62e016e7ee85e5ad4c0d4459f35d21f3 Mon Sep 17 00:00:00 2001 From: Jonas Maison Date: Fri, 10 Nov 2023 12:37:49 +0100 Subject: [PATCH] fix: don't query annotations resolver on LTS (#1582) --- src/kili/adapters/kili_api_gateway/label/common.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/kili/adapters/kili_api_gateway/label/common.py b/src/kili/adapters/kili_api_gateway/label/common.py index 0e06c68f2..039d40591 100644 --- a/src/kili/adapters/kili_api_gateway/label/common.py +++ b/src/kili/adapters/kili_api_gateway/label/common.py @@ -5,6 +5,7 @@ from kili.core.graphql.graphql_client import GraphQLClient from kili.domain.label import LabelId from kili.domain.types import ListOrTuple +from kili.exceptions import GraphQLError from .operations import get_annotations_query @@ -28,5 +29,12 @@ def list_annotations( video_transcription_annotation_fragment=fragment_builder(video_transcription_fields), ) variables = {"where": {"labelId": label_id}} - result = graphql_client.execute(query, variables) + + try: + result = graphql_client.execute(query, variables) + except GraphQLError as err: + if "Cannot query field" in str(err): # not available on LTS + return [] + raise + return result["data"]