Skip to content

Commit a5c73c9

Browse files
hf-kkleinKonstantin
andauthored
fix: use "SG\d+" as Segment Group ID, not "\d+" alone (#143)
--------- Co-authored-by: Konstantin <[email protected]>
1 parent 087addd commit a5c73c9

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

src/fundamend/reader/ahbreader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def _to_segment_group(element: ET.Element) -> SegmentGroup:
153153
else:
154154
raise ValueError(f"unexpected element: {child.tag}")
155155
return SegmentGroup(
156-
id=lstrip("G_SG", element.tag),
156+
id=lstrip("G_", element.tag),
157157
name=element.attrib["Name"],
158158
ahb_status=(
159159
element.attrib["AHB_Status"].strip() or None

src/fundamend/reader/migreader.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def _to_segment_group(element: ET.Element) -> SegmentGroup:
109109
else:
110110
raise ValueError(f"unexpected element: {child.tag}")
111111
return SegmentGroup(
112-
id=lstrip("G_SG", element.tag),
112+
id=lstrip("G_", element.tag),
113113
name=element.attrib["Name"],
114114
status_std=MigStatus(element.attrib["Status_Std"]),
115115
status_specification=MigStatus(element.attrib["Status_Specification"]),

src/fundamend/sqlmodels/materialize_ahb_view.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ WITH RECURSIVE
1212
ordered_roots AS (SELECT sg.primary_key,
1313
sg.position,
1414
'segment_group' AS type,
15-
'SG' || sg.id AS root_id_text,
15+
sg.id AS root_id_text,
1616
sg.name,
1717
sg.ahb_status,
1818
sg.anwendungsfall_primary_key,
@@ -134,7 +134,7 @@ WITH RECURSIVE
134134
'segment_group',
135135
h.source_id,
136136
h.sort_path || substr('00000' || child.position, -5) || '-',
137-
h.id_path || 'SG' || child.id || '>',
137+
h.id_path || child.id || '>',
138138
h.pruefidentifikator,
139139
h.format,
140140
h.versionsnummer,
@@ -146,7 +146,7 @@ WITH RECURSIVE
146146
h.anwendungshandbuch_primary_key,
147147
h.is_on_uebertragungsdatei_level,
148148

149-
'SG' || child.id,
149+
child.id,
150150
child.name,
151151
child.ahb_status,
152152
child.position,

unittests/__snapshots__/test_ahbreader.ambr

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

unittests/__snapshots__/test_migreader.ambr

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)