Skip to content

Commit 92c1257

Browse files
committed
for empty properties that allow arrays, return None not [None]
1 parent 56282a4 commit 92c1257

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pipeline/src/base.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,12 @@ def value_to_jsonld(value):
7171
value = getattr(self, property.name)
7272
if value or include_empty_properties:
7373
if property.multiple:
74-
if not isinstance(value, (tuple, list)):
75-
value = [value]
76-
data[property.path] = [value_to_jsonld(item) for item in value]
74+
if value is None:
75+
data[property.path] = value
76+
else:
77+
if not isinstance(value, (tuple, list)):
78+
value = [value]
79+
data[property.path] = [value_to_jsonld(item) for item in value]
7780
else:
7881
data[property.path] = value_to_jsonld(value)
7982
return {key: data[key] for key in sorted(data)}

0 commit comments

Comments
 (0)