From 6c04dbf3b851c513b5064a30de52e61addd5b774 Mon Sep 17 00:00:00 2001 From: Manuel Schmidt Date: Fri, 9 Aug 2024 20:10:13 +0200 Subject: [PATCH] Fixed small bug and docs for #143 --- xbrl/instance.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/xbrl/instance.py b/xbrl/instance.py index 198c0b1..4f634de 100644 --- a/xbrl/instance.py +++ b/xbrl/instance.py @@ -35,7 +35,8 @@ "xbrldi": "http://xbrl.org/2006/xbrldi" } -class AbstractMember: + +class AbstractMember(abc.ABC): def __init__(self, dimension: Concept) -> None: self.dimension = dimension @@ -53,10 +54,12 @@ def to_json(self): class TypedMember(AbstractMember): """ - Representation of an explicit member in xbrl. + Representation of a typed member in xbrl. XML Example: - aapl:EuropeSegmentMember + + 2024-06-30 + """ def __init__(self, dimension: Concept, domain: List[str]) -> None: super().__init__(dimension) @@ -251,7 +254,8 @@ def json(self, **kwargs) -> dict: kwargs['dimensions']['contextId'] = self.context.xml_id kwargs['dimensions']['period'] = period for segment in self.context.segments: - kwargs['dimensions'][segment.dimension.name] = segment.member.name + if isinstance(segment, ExplicitMember): + kwargs['dimensions'][segment.dimension.name] = segment.member.name return kwargs