From 800bf2f5b00086aa1611ae0dcd0526df03dc39ae Mon Sep 17 00:00:00 2001 From: Gordon Krieger Date: Tue, 18 Jun 2024 19:51:08 +0000 Subject: [PATCH 1/7] handle variants queries gracefully when not using gohan --- bento_beacon/utils/search.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bento_beacon/utils/search.py b/bento_beacon/utils/search.py index 0bb5c66..c27d91d 100644 --- a/bento_beacon/utils/search.py +++ b/bento_beacon/utils/search.py @@ -1,6 +1,8 @@ +from flask import current_app from functools import reduce from .gohan_utils import query_gohan from .katsu_utils import katsu_filters_query, search_from_config, biosample_ids_for_individuals +from .beacon_response import add_info_to_response # TODO: search by linked field set elements instead of hardcoding @@ -11,6 +13,10 @@ def biosample_id_search(variants_query=None, phenopacket_filters=None, experimen return [] if variants_query: + if not current_app.config["BEACON_CONFIG"].get("useGohan"): + # variants query even though there are no variants in this beacon, this can happen in a network context + add_info_to_response("No variants available at this beacon, query by metadata values only") + return [] variant_sample_ids = query_gohan(variants_query, "count", ids_only=True) if not variant_sample_ids: return [] From a3e1c22f013be14e910216571992d9db81db4bb8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 6 Jul 2024 02:27:14 +0000 Subject: [PATCH 2/7] Bump certifi from 2024.6.2 to 2024.7.4 Bumps [certifi](https://github.com/certifi/python-certifi) from 2024.6.2 to 2024.7.4. - [Commits](https://github.com/certifi/python-certifi/compare/2024.06.02...2024.07.04) --- updated-dependencies: - dependency-name: certifi dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 10a5477..5409b32 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ async-timeout==4.0.3 attrs==22.2.0 autopep8==1.6.0 bento-lib==10.1.1 -certifi==2024.6.2 +certifi==2024.7.4 cffi==1.15.1 charset-normalizer==2.1.1 click==8.1.7 From 47f3150df84d3a1e4f42f969df058fa7f1bf65d7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 19:01:12 +0000 Subject: [PATCH 3/7] Bump zipp from 3.17.0 to 3.19.1 Bumps [zipp](https://github.com/jaraco/zipp) from 3.17.0 to 3.19.1. - [Release notes](https://github.com/jaraco/zipp/releases) - [Changelog](https://github.com/jaraco/zipp/blob/main/NEWS.rst) - [Commits](https://github.com/jaraco/zipp/compare/v3.17.0...v3.19.1) --- updated-dependencies: - dependency-name: zipp dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5409b32..8da0f26 100644 --- a/requirements.txt +++ b/requirements.txt @@ -49,4 +49,4 @@ urllib3==1.26.19 webcolors==1.12 Werkzeug==2.2.3 yarl==1.9.3 -zipp==3.17.0 +zipp==3.19.1 From 9f8fb3b144b36ef1f2e1deff13eae0f86e7d9ff2 Mon Sep 17 00:00:00 2001 From: v-rocheleau Date: Tue, 16 Jul 2024 14:35:33 -0400 Subject: [PATCH 4/7] feat: use public rules endpoint --- bento_beacon/config_files/config.py | 1 + bento_beacon/utils/katsu_utils.py | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/bento_beacon/config_files/config.py b/bento_beacon/config_files/config.py index baf6f3e..8a6cf17 100644 --- a/bento_beacon/config_files/config.py +++ b/bento_beacon/config_files/config.py @@ -149,6 +149,7 @@ class Config: KATSU_SEARCH_OVERVIEW = "/api/search_overview" KATSU_PRIVATE_OVERVIEW = "/api/overview" KATSU_PUBLIC_OVERVIEW = "/api/public_overview" + KATSU_PUBLIC_RULES = "/api/public_rules" KATSU_TIMEOUT = int(os.environ.get("BEACON_KATSU_TIMEOUT", 180)) MAP_EXTRA_PROPERTIES_TO_INFO = os.environ.get("MAP_EXTRA_PROPERTIES_TO_INFO", True) diff --git a/bento_beacon/utils/katsu_utils.py b/bento_beacon/utils/katsu_utils.py index 341cc71..a1294ba 100644 --- a/bento_beacon/utils/katsu_utils.py +++ b/bento_beacon/utils/katsu_utils.py @@ -278,9 +278,10 @@ def overview_statistics(): def katsu_censorship_settings() -> tuple[int | None, int | None]: - overview = katsu_get(current_app.config["KATSU_PUBLIC_OVERVIEW"]) - max_filters = overview.get("max_query_parameters") - count_threshold = overview.get("count_threshold") + # TODO: should be project-dataset scoped + rules = katsu_get(current_app.config["KATSU_PUBLIC_RULES"]) + max_filters = rules.get("max_query_parameters") + count_threshold = rules.get("count_threshold") # return even if None return max_filters, count_threshold From 684bc863fe3a81a39926db64b5d4f722a76eec4a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Aug 2024 18:20:07 +0000 Subject: [PATCH 5/7] Bump aiohttp from 3.9.5 to 3.10.2 Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.9.5 to 3.10.2. - [Release notes](https://github.com/aio-libs/aiohttp/releases) - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst) - [Commits](https://github.com/aio-libs/aiohttp/compare/v3.9.5...v3.10.2) --- updated-dependencies: - dependency-name: aiohttp dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8da0f26..7bffa85 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -aiohttp==3.9.5 +aiohttp==3.10.2 aiosignal==1.3.1 annotated-types==0.6.0 arrow==1.2.3 From e596d2282a83503efca4da3e0553e9827f43d761 Mon Sep 17 00:00:00 2001 From: Gordon Krieger Date: Mon, 12 Aug 2024 14:43:05 +0000 Subject: [PATCH 6/7] update katsu schema endpoints --- bento_beacon/config_files/config.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bento_beacon/config_files/config.py b/bento_beacon/config_files/config.py index 8a6cf17..a228b86 100644 --- a/bento_beacon/config_files/config.py +++ b/bento_beacon/config_files/config.py @@ -143,8 +143,8 @@ class Config: KATSU_DISEASES_TERMS_ENDPOINT = "/api/disease_term_autocomplete" KATSU_SAMPLED_TISSUES_TERMS_ENDPOINT = "/api/biosample_sampled_tissue_autocomplete" KATSU_PUBLIC_CONFIG_ENDPOINT = "/api/public_search_fields" - KATSU_INDIVIDUAL_SCHEMA_ENDPOINT = "/api/chord_phenopacket_schema" - KATSU_EXPERIMENT_SCHEMA_ENDPOINT = "/api/experiment_schema" + KATSU_INDIVIDUAL_SCHEMA_ENDPOINT = "/api/schemas/phenopacket" + KATSU_EXPERIMENT_SCHEMA_ENDPOINT = "/api/schemas/experiment" KATSU_BEACON_SEARCH = "/api/beacon_search" KATSU_SEARCH_OVERVIEW = "/api/search_overview" KATSU_PRIVATE_OVERVIEW = "/api/overview" From 19af638a36cacc59b7b3212d1bb09f4ff2a53041 Mon Sep 17 00:00:00 2001 From: Gordon Krieger Date: Mon, 12 Aug 2024 16:13:06 +0000 Subject: [PATCH 7/7] all default handling for optional field welcomeUrl --- bento_beacon/endpoints/info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bento_beacon/endpoints/info.py b/bento_beacon/endpoints/info.py index aead8f2..8a43678 100644 --- a/bento_beacon/endpoints/info.py +++ b/bento_beacon/endpoints/info.py @@ -146,7 +146,7 @@ def build_ga4gh_service_info(): "name": info["name"], "type": {"artifact": "Beacon v2", "group": "org.ga4gh", "version": info["apiVersion"]}, "environment": info["environment"], - "organization": {"name": info["organization"]["name"], "url": info["organization"]["welcomeUrl"]}, + "organization": {"name": info["organization"]["name"], "url": info["organization"].get("welcomeUrl", "")}, "contactUrl": info["organization"]["contactUrl"], "version": info["version"], "bento": {"serviceKind": "beacon"},