From aedebccc3d47eceba128333138ad41b6d3404587 Mon Sep 17 00:00:00 2001 From: Christoph Zwerschke Date: Fri, 26 Jul 2024 10:19:04 +0000 Subject: [PATCH 1/2] Support schema v2 in global stats --- src/metldata/load/stats.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/metldata/load/stats.py b/src/metldata/load/stats.py index a1fea68..846298a 100644 --- a/src/metldata/load/stats.py +++ b/src/metldata/load/stats.py @@ -32,15 +32,20 @@ STATS_COLLECTION_NAME = "stats" +# the following should be made configurable + + def get_stat_slot(resource_class: str) -> str | None: """Get the name of the slot that shall be used as grouping key.""" if resource_class.endswith("File"): return "format" - if resource_class.endswith("Protocol"): + if resource_class.endswith("Protocol"): # v1 return "type" - if resource_class.endswith("Individual"): - return "sex" - return None + return { + "Individual": "sex", + "Sample": "type", + "ExperimentMethod": "instrument_model", # v2 + }.get(resource_class) async def create_stats_using_aggregator( From a9bd05798c0f9464aea84e5644591b669813ea89 Mon Sep 17 00:00:00 2001 From: Christoph Zwerschke Date: Fri, 26 Jul 2024 10:25:43 +0000 Subject: [PATCH 2/2] Bump version --- .pyproject_generation/pyproject_custom.toml | 2 +- README.md | 6 +++--- pyproject.toml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pyproject_generation/pyproject_custom.toml b/.pyproject_generation/pyproject_custom.toml index 423baaf..31c8dfe 100644 --- a/.pyproject_generation/pyproject_custom.toml +++ b/.pyproject_generation/pyproject_custom.toml @@ -1,6 +1,6 @@ [project] name = "metldata" -version = "2.0.0" +version = "2.0.1" description = "metldata - A framework for handling metadata based on ETL, CQRS, and event sourcing." dependencies = [ "hexkit[akafka,mongodb] >=3, <4", diff --git a/README.md b/README.md index d383fea..5e609cd 100644 --- a/README.md +++ b/README.md @@ -58,13 +58,13 @@ We recommend using the provided Docker container. A pre-build version is available at [docker hub](https://hub.docker.com/repository/docker/ghga/metldata): ```bash -docker pull ghga/metldata:2.0.0 +docker pull ghga/metldata:2.0.1 ``` Or you can build the container yourself from the [`./Dockerfile`](./Dockerfile): ```bash # Execute in the repo's root dir: -docker build -t ghga/metldata:2.0.0 . +docker build -t ghga/metldata:2.0.1 . ``` For production-ready deployment, we recommend using Kubernetes, however, @@ -72,7 +72,7 @@ for simple use cases, you could execute the service using docker on a single server: ```bash # The entrypoint is preconfigured: -docker run -p 8080:8080 ghga/metldata:2.0.0 --help +docker run -p 8080:8080 ghga/metldata:2.0.1 --help ``` If you prefer not to use containers, you may install the service from source: diff --git a/pyproject.toml b/pyproject.toml index b3549dd..25faf2c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,7 +21,7 @@ classifiers = [ "Intended Audience :: Developers", ] name = "metldata" -version = "2.0.0" +version = "2.0.1" description = "metldata - A framework for handling metadata based on ETL, CQRS, and event sourcing." dependencies = [ "hexkit[akafka,mongodb] >=3, <4",