diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 44019627..c5cf091a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,4 +18,4 @@ jobs: - name: Install black run: python -m pip install black - name: Run linter - run: black --check --line-length=120 ./bento_beacon \ No newline at end of file + run: black --check --line-length=120 ./bento_beacon diff --git a/Dockerfile b/Dockerfile index ff53b624..92be6137 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/bento-platform/bento_base_image:python-debian-2024.04.01 +FROM ghcr.io/bento-platform/bento_base_image:python-debian-2024.06.01 SHELL ["/bin/bash", "-c"] diff --git a/bento_beacon/config_files/config.py b/bento_beacon/config_files/config.py index 8a6cf171..a228b866 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" diff --git a/bento_beacon/endpoints/info.py b/bento_beacon/endpoints/info.py index aead8f23..8a436789 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"}, diff --git a/bento_beacon/utils/search.py b/bento_beacon/utils/search.py index 0bb5c664..c27d91da 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 [] diff --git a/dev.Dockerfile b/dev.Dockerfile index 07262c63..fa42e2d2 100644 --- a/dev.Dockerfile +++ b/dev.Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/bento-platform/bento_base_image:python-debian-2024.04.01 +FROM ghcr.io/bento-platform/bento_base_image:python-debian-2024.06.01 LABEL org.opencontainers.image.description="Local development image for the Bento Beacon service." LABEL devcontainer.metadata='[{ \ diff --git a/requirements.txt b/requirements.txt index 0442b477..8da0f262 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,11 +6,11 @@ async-timeout==4.0.3 attrs==22.2.0 autopep8==1.6.0 bento-lib==10.1.1 -certifi==2024.2.2 +certifi==2024.7.4 cffi==1.15.1 charset-normalizer==2.1.1 click==8.1.7 -cryptography==42.0.5 +cryptography==42.0.8 flake8==6.1.0 Flask==2.2.5 Flask-Cors==4.0.1 @@ -45,8 +45,8 @@ six==1.16.0 toml==0.10.2 typing_extensions==4.8.0 uri-template==1.2.0 -urllib3==1.26.18 +urllib3==1.26.19 webcolors==1.12 Werkzeug==2.2.3 yarl==1.9.3 -zipp==3.17.0 +zipp==3.19.1