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
Next Next commit
fix: Address review feedback for UUID type support
Signed-off-by: soojin <soojin@dable.io>
  • Loading branch information
soooojinlee authored and ntkathole committed Apr 1, 2026
commit 8e15939cbe72c2a26fa19252355ae030d8823213
11 changes: 9 additions & 2 deletions sdk/python/feast/infra/online_stores/online_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,12 +391,19 @@ async def query_table(table, requested_features):
def _build_feature_types(
grouped_refs: List,
) -> Dict[str, ValueType]:
"""Build a mapping of feature names to ValueType from grouped feature view refs."""
"""Build a mapping of feature names to ValueType from grouped feature view refs.

Includes both bare names and prefixed names (feature_view__feature) so that
lookups succeed regardless of the full_feature_names setting.
"""
feature_types: Dict[str, ValueType] = {}
for table, requested_features in grouped_refs:
table_name = table.projection.name_to_use()
for field in table.features:
if field.name in requested_features:
feature_types[field.name] = field.dtype.to_value_type()
vtype = field.dtype.to_value_type()
feature_types[field.name] = vtype
feature_types[f"{table_name}__{field.name}"] = vtype
Comment thread
soooojinlee marked this conversation as resolved.
return feature_types
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.

@abstractmethod
Expand Down
13 changes: 13 additions & 0 deletions sdk/python/feast/type_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,19 @@ def _convert_list_values_to_proto(
if feast_value_type == ValueType.BOOL_LIST:
return _convert_bool_collection_to_proto(values, field_name, proto_type)

if feast_value_type in (ValueType.UUID_LIST, ValueType.TIME_UUID_LIST):
# uuid.UUID objects must be converted to str for StringList proto.
return [
(
ProtoValue(
**{field_name: proto_type(val=[str(e) for e in value])} # type: ignore[arg-type]
)
if value is not None
else ProtoValue()
)
for value in values
]

# Generic list conversion
return [
ProtoValue(**{field_name: proto_type(val=value)}) # type: ignore[arg-type]
Expand Down
16 changes: 16 additions & 0 deletions sdk/python/tests/unit/test_type_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,22 @@ def test_uuid_list_roundtrip(self):
assert all(isinstance(r, uuid.UUID) for r in result)
assert result == test_uuids

def test_uuid_object_list_roundtrip(self):
"""uuid.UUID objects in list -> proto -> list of uuid.UUID roundtrip."""
test_uuids = [uuid.uuid4(), uuid.uuid4(), uuid.uuid4()]
protos = python_values_to_proto_values([test_uuids], ValueType.UUID_LIST)
result = feast_value_type_to_python_type(protos[0])
assert all(isinstance(r, uuid.UUID) for r in result)
assert result == test_uuids

def test_time_uuid_object_list_roundtrip(self):
"""uuid.UUID objects in TIME_UUID list -> proto -> roundtrip."""
test_uuids = [uuid.uuid1(), uuid.uuid1()]
protos = python_values_to_proto_values([test_uuids], ValueType.TIME_UUID_LIST)
result = feast_value_type_to_python_type(protos[0])
assert all(isinstance(r, uuid.UUID) for r in result)
assert result == test_uuids

def test_pg_uuid_type_mapping(self):
"""PostgreSQL uuid type maps to ValueType.UUID."""
assert pg_type_to_feast_value_type("uuid") == ValueType.UUID
Expand Down