feat: skip keys in int conversion

This commit is contained in:
Jonathan Kössler 2024-09-25 11:07:20 +02:00
parent 3bab86fe83
commit e75df42bec

View File

@ -87,8 +87,13 @@ class ProtoDataLoader:
def convert_int64_fields(obj):
# FIXME: find a more sophisticated way to convert int64 fields (defaults to str in python)
# we skip the following keys because the values are expected to be of type str
skip_keys = ["col", "row", "numberOfCols", "numberOfRows"]
if isinstance(obj, dict):
for key, value in obj.items():
if key in skip_keys:
continue
obj[key] = convert_int64_fields(value)
elif isinstance(obj, list):
return [convert_int64_fields(item) for item in obj]