From 5d1bf116b27bf0be35beaf320530e14fecf336e4 Mon Sep 17 00:00:00 2001 From: Ayaan Kakkar Date: Sun, 22 Sep 2024 20:45:31 -0700 Subject: [PATCH] Bug fix --- src/graphql/models/annotation_model.py | 2 +- src/graphql/resolvers/helper_resolver.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/graphql/models/annotation_model.py b/src/graphql/models/annotation_model.py index 8cc6f0b..22500b7 100644 --- a/src/graphql/models/annotation_model.py +++ b/src/graphql/models/annotation_model.py @@ -23,7 +23,7 @@ class DocCount: @strawberry.input class Histogram: - interval: Optional[int] = 4893.27 + interval: Optional[float] = 4893.27 min: Optional[int] = 10636 max: Optional[int] = 499963 diff --git a/src/graphql/resolvers/helper_resolver.py b/src/graphql/resolvers/helper_resolver.py index a68e562..c5aa7e8 100644 --- a/src/graphql/resolvers/helper_resolver.py +++ b/src/graphql/resolvers/helper_resolver.py @@ -1,5 +1,6 @@ import inspect import json +import typing from typing import Dict from src.graphql.gene_pos import get_pos_from_gene_id, map_gene, chromosomal_location_dic from src.graphql.models.snp_model import ScrollSnp, Snp, SnpAggs @@ -263,7 +264,7 @@ async def get_aggregation_query(aggregation_fields: list[tuple[str, list[str]]], # Check the type of the field. If it is a string, then we have to add .keyword to the field name while querying missing and frequency # Using the pydantic model Snp, we can check the type of the field - is_text_field = inspect.get_annotations(Snp)[field] == str + is_text_field = typing.get_args(inspect.get_annotations(Snp)[field])[0] == str textual_suffix = '.keyword' if is_text_field else '' for subfield in subfields: