feat: skip keys in int conversion
This commit is contained in:
parent
3bab86fe83
commit
e75df42bec
@ -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]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user