Skip to content

Commit

Permalink
Avoid internal warning in StructureMessage definition
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Jan 10, 2024
1 parent 85f7f82 commit 24234ca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sdmx/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions sdmx/tests/model/test_v21.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 24234ca

Please sign in to comment.