From 24234ca8df0349977c2886ce0eb4150bc4bf89ce Mon Sep 17 00:00:00 2001 From: Paul Natsuo Kishimoto Date: Wed, 10 Jan 2024 13:47:58 +0100 Subject: [PATCH] Avoid internal warning in StructureMessage definition --- sdmx/message.py | 4 ++-- sdmx/tests/model/test_v21.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sdmx/message.py b/sdmx/message.py index 514598b9..b64ef2b1 100644 --- a/sdmx/message.py +++ b/sdmx/message.py @@ -193,7 +193,7 @@ class StructureMessage(Message): #: Collection of :class:`.Codelist`. codelist: DictLikeDescriptor[str, model.Codelist] = DictLikeDescriptor() #: Collection of :class:`.HierarchicalCodelist`. - hierarchical_code_list: DictLikeDescriptor[ + hierarchical_codelist: DictLikeDescriptor[ str, v21.HierarchicalCodelist ] = DictLikeDescriptor() #: Collection of :class:`.v30.Hierarchy`. @@ -216,7 +216,7 @@ class StructureMessage(Message): str, model.BaseDataStructureDefinition ] = DictLikeDescriptor() #: Collection of :class:`.StructureSet`. - structureset: DictLikeDescriptor[str, model.StructureSet] = DictLikeDescriptor() + structureset: DictLikeDescriptor[str, v21.StructureSet] = DictLikeDescriptor() #: Collection of :class:`.OrganisationScheme`. organisation_scheme: DictLikeDescriptor[ str, model.OrganisationScheme diff --git a/sdmx/tests/model/test_v21.py b/sdmx/tests/model/test_v21.py index 5b57a832..67192d72 100644 --- a/sdmx/tests/model/test_v21.py +++ b/sdmx/tests/model/test_v21.py @@ -611,11 +611,11 @@ def msg(self, specimen): return sdmx.read_sdmx(f) def test_hierarchy(self, msg: sdmx.message.StructureMessage) -> None: - for key, hcl in msg.hierarchical_code_list.items(): + for key, hcl in msg.hierarchical_codelist.items(): assert 1 == len(hcl.hierarchy) # print(f"{hcl = }") - hcl = msg.hierarchical_code_list["BIS:HCL_COUNTRY(1.0)"] + hcl = msg.hierarchical_codelist["BIS:HCL_COUNTRY(1.0)"] # Access a Hierarchy h = hcl.hierarchy[0]