From 4cc47702d75cdd778d47ac680bd3f48efa1513d7 Mon Sep 17 00:00:00 2001 From: David Lougheed Date: Thu, 30 Nov 2023 13:49:04 -0500 Subject: [PATCH] fix(service_info): make service org pydantic model immutable --- bento_lib/package.cfg | 2 +- bento_lib/service_info/types.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bento_lib/package.cfg b/bento_lib/package.cfg index 66ab986..ded5bad 100644 --- a/bento_lib/package.cfg +++ b/bento_lib/package.cfg @@ -1,5 +1,5 @@ [package] name = bento_lib -version = 11.0.0a1 +version = 11.0.0a2 authors = David Lougheed, Paul Pillot author_emails = david.lougheed@mail.mcgill.ca, paul.pillot@computationalgenomics.ca diff --git a/bento_lib/service_info/types.py b/bento_lib/service_info/types.py index 905fa43..1e0ceaa 100644 --- a/bento_lib/service_info/types.py +++ b/bento_lib/service_info/types.py @@ -24,7 +24,8 @@ class GA4GHServiceOrganization(TypedDict): class GA4GHServiceOrganizationModel(BaseModel): name: str url: str - model_config = ConfigDict(extra="forbid") + # frozen=True makes this hashable + immutable + model_config = ConfigDict(extra="forbid", frozen=True) # TODO: py3.11: Required[] instead of base class