Skip to content

Commit 7385f53

Browse files
committed
[VersionConverter] Replace value type 'binary'
Closes #281 Value data type 'binary' is no longer supported. Replace it with 'text' during version conversion.
1 parent dba074b commit 7385f53

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

odml/tools/version_converter.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,10 +356,22 @@ def _handle_value(self, value, log_id):
356356
elif val_elem.tag in format.Property.arguments_keys:
357357
new_elem = ET.Element(val_elem.tag)
358358
new_elem.text = val_elem.text
359+
360+
if val_elem.tag in ["type", "dtype"] and val_elem.text == "binary":
361+
new_elem.text = "text"
362+
self._log("[Warning] Replacing unsupported value type "
363+
"'binary' with 'text' (%s)" % log_id)
364+
359365
parent.append(new_elem)
360366
elif val_elem.tag in self._version_map:
361367
new_elem = ET.Element(self._version_map[val_elem.tag])
362368
new_elem.text = val_elem.text
369+
370+
if val_elem.tag in ["type", "dtype"] and val_elem.text == "binary":
371+
new_elem.text = "text"
372+
self._log("[Warning] Replacing unsupported value type "
373+
"'binary' with 'text' (%s)" % log_id)
374+
363375
parent.append(new_elem)
364376
else:
365377
self._log("[Info] Omitted non-Value attribute '%s: %s/%s'"

0 commit comments

Comments
 (0)