From 814bc57401baaef06b0b18cf34d98583ccc8e058 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Wed, 30 Jul 2025 13:03:50 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Fix=20recordIdentifier=20attribu?= =?UTF-8?q?te=20'type'=20'zdb'=20=20to=20the=20correct=20'source'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mods4pandas/lib.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mods4pandas/lib.py b/src/mods4pandas/lib.py index 0cf0407..4bf182f 100644 --- a/src/mods4pandas/lib.py +++ b/src/mods4pandas/lib.py @@ -269,6 +269,14 @@ class TagGroup: counts = {f"{xpath_expr}-count": len(values)} return counts + def fix_recordIdentifier_source_zdb(self) -> TagGroup: + for e in self.group: + if e.get("type") == "zdb": + e.attrib["source"] = "zdb" + del e.attrib["type"] + warnings.warn("Fixed recordIdentifier type 'zdb' to source") + return self + def sorted_groupby(iterable, key=None): """