Skip to content
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

add units to /filtering_terms response #126

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion bento_beacon/utils/katsu_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down