Skip to content

Commit

Permalink
Handle valid{From,To} attrs in xml.v21.Reader.maintainable()
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Oct 9, 2023
1 parent ad90c6d commit 75921ba
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions sdmx/reader/xml/v21.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,15 @@ def maintainable(self, cls, elem, **kwargs):
the same object ID will return references to the same object.
"""
kwargs.setdefault("is_external_reference", elem is None)
setdefault_attrib(kwargs, elem, "isExternalReference", "isFinal", "version")
setdefault_attrib(
kwargs,
elem,
"isExternalReference",
"isFinal",
"validFrom",
"validTo",
"version",
)
kwargs["is_final"] = kwargs.get("is_final", None) == "true"

# Create a candidate object
Expand Down Expand Up @@ -1393,7 +1401,6 @@ def _cc(reader, elem):
else:
content.add(resolved)

# return reader.nameable(
return reader.maintainable(
cls,
elem,
Expand Down

0 comments on commit 75921ba

Please sign in to comment.