From 84a4c5379324f2ecc181e5a56e8c136fd38abd2b Mon Sep 17 00:00:00 2001 From: Gordon Krieger Date: Tue, 25 Feb 2025 19:25:48 +0000 Subject: [PATCH] add optional units to /filtering_terms response --- bento_beacon/utils/katsu_utils.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bento_beacon/utils/katsu_utils.py b/bento_beacon/utils/katsu_utils.py index cd905a4..43b3887 100644 --- a/bento_beacon/utils/katsu_utils.py +++ b/bento_beacon/utils/katsu_utils.py @@ -254,7 +254,7 @@ async def katsu_config_filtering_terms(project_id, dataset_id): "id": field["id"], "label": field["title"], # - # longer lablel / helptext + # longer label / helptext "description": field.get("description", ""), # # bento internal use fields, more to come @@ -272,6 +272,11 @@ async def katsu_config_filtering_terms(project_id, dataset_id): # filter scope for us is always all queryable entities in this beacon, but that can vary per beacon # we can infer this from the queryable endpoints / blueprints that are active } + + # optional field not in spec + if units := field.get("config", {}).get("units"): + filtering_term["units"] = units + filtering_terms.append(filtering_term) return filtering_terms