Skip to content

Commit 814bc57

Browse files
committed
🧹 Fix recordIdentifier attribute 'type' 'zdb' to the correct 'source'
1 parent b12973a commit 814bc57

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/mods4pandas/lib.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,14 @@ def xpath_count(self, xpath_expr, namespaces) -> dict[str, int]:
269269
counts = {f"{xpath_expr}-count": len(values)}
270270
return counts
271271

272+
def fix_recordIdentifier_source_zdb(self) -> TagGroup:
273+
for e in self.group:
274+
if e.get("type") == "zdb":
275+
e.attrib["source"] = "zdb"
276+
del e.attrib["type"]
277+
warnings.warn("Fixed recordIdentifier type 'zdb' to source")
278+
return self
279+
272280

273281
def sorted_groupby(iterable, key=None):
274282
"""

0 commit comments

Comments
 (0)