Skip to content

Commit f9ee82d

Browse files
soooojinleeclaude
andcommitted
fix: Add np.ndarray support in nested collection proto conversion and clarify placeholder pyarrow type
- Add np.ndarray to isinstance check in _convert_nested_collection_to_proto to fix KeyError for 3+ level nesting during materialization (PyArrow produces np.ndarray, not Python list) - Add comment clarifying VALUE_LIST/VALUE_SET placeholder in feast_value_type_to_pa Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent e558c81 commit f9ee82d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sdk/python/feast/type_map.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1088,7 +1088,8 @@ def _convert_nested_collection_to_proto(
10881088
# Empty inner collection: store as empty ProtoValue
10891089
inner_values.append(ProtoValue())
10901090
elif any(
1091-
isinstance(item, (list, set, tuple)) for item in inner_list
1091+
isinstance(item, (list, set, tuple, np.ndarray))
1092+
for item in inner_list
10921093
):
10931094
# Deeper nesting (3+ levels): recurse using VALUE_LIST
10941095
inner_proto = _convert_nested_collection_to_proto(
@@ -1765,6 +1766,8 @@ def feast_value_type_to_pa(
17651766
ValueType.JSON_LIST: pyarrow.list_(pyarrow.large_string()),
17661767
ValueType.STRUCT: pyarrow.struct([]),
17671768
ValueType.STRUCT_LIST: pyarrow.list_(pyarrow.struct([])),
1769+
# Placeholder: inner type is unknown from ValueType alone.
1770+
# Callers needing accurate inner types should use from_feast_to_pyarrow_type() with a FeastType.
17681771
ValueType.VALUE_LIST: pyarrow.list_(pyarrow.list_(pyarrow.string())),
17691772
ValueType.VALUE_SET: pyarrow.list_(pyarrow.list_(pyarrow.string())),
17701773
ValueType.NULL: pyarrow.null(),

0 commit comments

Comments
 (0)