← 返回首页
fix: Null value compatibility for unit timestamp list value type by EXPEbdodla · Pull Request #4378 · feast-dev/feast · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected Viewed files
Conversations
Failed to load comments. Retry
Loading
Jump to
Jump to file
Failed to load files. Retry
Loading
Diff view
Unified
Split
Hide whitespace
Apply and reload
Show whitespace
Diff view
Unified
Split
Hide whitespace
Apply and reload
17 changes: 11 additions & 6 deletions sdk/python/feast/type_map.py
Show comments View file Edit file Delete file Open in desktop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -396,13 +396,18 @@ def _python_value_to_proto_value(
raise _type_err(item, valid_types[0])

if feast_value_type == ValueType.UNIX_TIMESTAMP_LIST:
int_timestamps_lists = (
_python_datetime_to_int_timestamp(value) for value in values
)
return [
# ProtoValue does actually accept `np.int_` but the typing complains.
ProtoValue(unix_timestamp_list_val=Int64List(val=ts)) # type: ignore
for ts in int_timestamps_lists
(
# ProtoValue does actually accept `np.int_` but the typing complains.
ProtoValue(
unix_timestamp_list_val=Int64List(
val=_python_datetime_to_int_timestamp(value) # type: ignore
)
)
if value is not None
else ProtoValue()
)
for value in values
]
if feast_value_type == ValueType.BOOL_LIST:
# ProtoValue does not support conversion of np.bool_ so we need to convert it to support np.bool_.
Expand Down
7 changes: 7 additions & 0 deletions sdk/python/tests/unit/test_type_map.py
Show comments View file Edit file Delete file Open in desktop
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,14 @@ def test_python_values_to_proto_values_bool(values):
(np.array([b'["a","b","c"]']), ValueType.STRING_LIST, ["a", "b", "c"]),
(np.array([b"[true,false]"]), ValueType.BOOL_LIST, [True, False]),
(np.array([b"[1,0]"]), ValueType.BOOL_LIST, [True, False]),
(np.array([None]), ValueType.INT32_LIST, None),
(np.array([None]), ValueType.INT64_LIST, None),
(np.array([None]), ValueType.FLOAT_LIST, None),
(np.array([None]), ValueType.DOUBLE_LIST, None),
(np.array([None]), ValueType.BOOL_LIST, None),
(np.array([None]), ValueType.BYTES_LIST, None),
(np.array([None]), ValueType.STRING_LIST, None),
(np.array([None]), ValueType.UNIX_TIMESTAMP_LIST, None),
([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
Toggle all file notes Toggle all file annotations

Footer

© 2026 GitHub, Inc.