Skip to content

Commit 0928caa

Browse files
committed
🧹 MODS: Only add type='text' if there is no type attribute
1 parent b9190a3 commit 0928caa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/mods4pandas/lib.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,10 @@ def fix_language_term(self) -> TagGroup:
201201

202202
def add_missing_type_text(self) -> TagGroup:
203203
for e in self.group:
204-
if not e.attrib.get("type") == "text":
204+
# Default to type=text
205+
if not "type" in e.attrib:
205206
e.attrib["type"] = "text"
206-
warnings.warn("Added type='text'")
207+
warnings.warn("Added placeTerm type='text'")
207208
return self
208209

209210
def remove_attributes(self, attribs) -> TagGroup:

0 commit comments

Comments
 (0)