Skip to content
Merged
Show file tree
Hide file tree
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
fix integration tests
Signed-off-by: Alan Gauthier <alan.gauthier@jobteaser.com>
  • Loading branch information
alan-gauthier-jt authored and ntkathole committed Jun 3, 2026
commit 066c9a229c4ee32ce5faffb943ba27cf49e1c00a
2 changes: 0 additions & 2 deletions sdk/python/feast/type_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -897,8 +897,6 @@ def _sanitize_list_value(value: Any, feast_value_type: ValueType) -> Any:
"""
if isinstance(value, np.ndarray):
value = value.tolist()
if isinstance(value, list) and len(value) == 0:
return None
none_default = _LIST_NONE_DEFAULTS.get(feast_value_type)
if none_default is not None and isinstance(value, list):
value = [none_default if v is None else v for v in value]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ def test_writing_consecutively_to_offline_store(environment, universal_data_sour
)

store.apply([driver_entity, driver_stats])
# Refresh registry after apply to ensure subsequent reads see the new feature view
store.refresh_registry()
df = store.get_historical_features(
entity_df=entity_df,
features=[
Expand Down
7 changes: 5 additions & 2 deletions sdk/python/tests/unit/test_type_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ def test_python_values_to_proto_values_bool(values):
(np.array([None]), ValueType.BYTES_LIST, None),
(np.array([None]), ValueType.STRING_LIST, None),
(np.array([None]), ValueType.UNIX_TIMESTAMP_LIST, None),
([np.array([], dtype=np.int32)], ValueType.INT32_LIST, []),
([np.array([], dtype=np.float32)], ValueType.FLOAT_LIST, []),
([np.array([], dtype=np.bool_)], ValueType.BOOL_LIST, []),
([b"[1,2,3]"], ValueType.INT64_LIST, [1, 2, 3]),
([b"[1,2,3]"], ValueType.INT32_LIST, [1, 2, 3]),
([b"[1.5,2.5,3.5]"], ValueType.FLOAT_LIST, [1.5, 2.5, 3.5]),
Expand Down Expand Up @@ -2094,12 +2097,12 @@ def test_sanitize_list_value_ndarray(self):
assert isinstance(result, list)

def test_sanitize_list_value_empty_ndarray(self):
"""Empty ndarray is converted to None (treated as a missing row)."""
"""Empty ndarray is converted to an empty Python list."""
from feast.type_map import _sanitize_list_value

arr = np.array([], dtype=object)
result = _sanitize_list_value(arr, ValueType.STRING_LIST)
assert result is None
assert result == []

def test_sanitize_list_value_ndarray_with_none(self):
"""None elements inside a STRING_LIST ndarray are replaced with empty string."""
Expand Down
Loading