Visitar URL original
fix: Handle numpy ndarray in Array(String) materialization by SIDDHESH1564 · Pull Request #6327 · feast-dev/feast · GitHub
Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: correct test expectations for empty ndarray list conversion
Signed-off-by: Siddhesh Khairnar <khairnarsiddhesh4057@gmail.com>
  • Loading branch information
SIDDHESH1564 committed Apr 25, 2026
commit c4b639851e891dff7f2251611e78a013f95eb80e
9 changes: 4 additions & 5 deletions sdk/python/tests/unit/test_type_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -1977,12 +1977,11 @@ def test_ndarray_string_list_with_none_elements(self):
assert converted == ["tag1", "", "tag3"]

def test_ndarray_empty_string_list(self):
"""An empty ndarray in a list column produces an empty ProtoValue (null)."""
from feast.protos.feast.types.Value_pb2 import Value as ProtoValue

"""An empty ndarray in a list column round-trips as an empty list."""
values = [np.array([], dtype=object)]
protos = python_values_to_proto_values(values, ValueType.STRING_LIST)
assert protos[0] == ProtoValue()
converted = feast_value_type_to_python_type(protos[0])
assert converted == []

def test_ndarray_string_list_mixed_batch(self):
"""Batch with populated ndarray, None, and empty ndarray."""
Expand All @@ -1996,7 +1995,7 @@ def test_ndarray_string_list_mixed_batch(self):
protos = python_values_to_proto_values(values, ValueType.STRING_LIST)
assert feast_value_type_to_python_type(protos[0]) == ["a", "b"]
assert protos[1] == ProtoValue()
assert protos[2] == ProtoValue()
assert feast_value_type_to_python_type(protos[2]) == []

def test_ndarray_int64_list_roundtrip(self):
"""ndarray of ints converts to INT64_LIST proto and back."""
Expand Down