Skip to content

Commit f03920a

Browse files
committed
don't remove empty maps
1 parent bf98721 commit f03920a

File tree

1 file changed

+13
-10
lines changed
  • raphtory-api/src/core/entities/properties/prop

1 file changed

+13
-10
lines changed

raphtory-api/src/core/entities/properties/prop/arrow.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -168,16 +168,19 @@ impl<'a> ArrowRow<'a> {
168168
}
169169

170170
pub fn into_prop(self) -> Option<Prop> {
171-
let map = Prop::map(
172-
self.array
173-
.fields()
174-
.iter()
175-
.enumerate()
176-
.filter_map(|(col, field)| Some((field.name().as_ref(), self.prop_value(col)?))),
177-
);
178-
match map {
179-
Prop::Map(m) if m.is_empty() => None,
180-
_ => Some(map),
171+
if self.index >= self.array.len() || self.array.is_null(self.index) {
172+
None
173+
} else {
174+
let map = Prop::map(
175+
self.array
176+
.fields()
177+
.iter()
178+
.enumerate()
179+
.filter_map(|(col, field)| {
180+
Some((field.name().as_ref(), self.prop_value(col)?))
181+
}),
182+
);
183+
Some(map)
181184
}
182185
}
183186

0 commit comments

Comments
 (0)