Skip to content

Commit 33038a6

Browse files
committed
Fixed test_retrieve_online_milvus_documents
Signed-off-by: ntkathole <[email protected]>
1 parent 0dcdbc5 commit 33038a6

File tree

4 files changed

+10
-13
lines changed

4 files changed

+10
-13
lines changed

sdk/python/feast/infra/online_stores/milvus_online_store/milvus.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -563,11 +563,16 @@ def retrieve_online_documents_v2(
563563
field, PrimitiveFeastType.INVALID
564564
) in [
565565
PrimitiveFeastType.STRING,
566+
PrimitiveFeastType.BYTES,
567+
]:
568+
res[field] = ValueProto(string_val=str(field_value))
569+
elif entity_name_feast_primitive_type_map.get(
570+
field, PrimitiveFeastType.INVALID
571+
) in [
566572
PrimitiveFeastType.INT64,
567573
PrimitiveFeastType.INT32,
568-
PrimitiveFeastType.BYTES,
569574
]:
570-
res[field] = ValueProto(string_val=field_value)
575+
res[field] = ValueProto(int64_val=int(field_value))
571576
elif field == composite_key_name:
572577
pass
573578
elif isinstance(field_value, bytes):

sdk/python/tests/integration/feature_repos/repo_configuration.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
)
9090

9191
DYNAMO_CONFIG = {"type": "dynamodb", "region": "us-west-2"}
92-
MILVUS_CONFIG = {"type": "milvus"}
92+
MILVUS_CONFIG = {"type": "milvus", "embedding_dim": "2"}
9393
REDIS_CONFIG = {"type": "redis", "connection_string": "localhost:6379,db=0"}
9494
REDIS_CLUSTER_CONFIG = {
9595
"type": "redis",
@@ -564,8 +564,7 @@ def construct_test_environment(
564564
path=str(Path(repo_dir_name) / "registry.db"),
565565
cache_ttl_seconds=1,
566566
)
567-
568-
if test_repo_config.online_store in ["milvus", "pgvector", "qdrant"]:
567+
if test_repo_config.online_store.get("type") in ["milvus", "pgvector", "qdrant"]:
569568
entity_key_serialization_version = 3
570569

571570
environment_params = {

sdk/python/tests/integration/feature_repos/universal/feature_views.py

-6
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,6 @@ def create_item_embeddings_feature_view(source, infer_features: bool = False):
160160
schema=None
161161
if infer_features
162162
else [
163-
Field(
164-
name="embedding_double",
165-
dtype=Array(Float64),
166-
vector_index=True,
167-
vector_search_metric="L2",
168-
),
169163
Field(
170164
name="embedding_float",
171165
dtype=Array(Float32),

sdk/python/tests/integration/online_store/test_universal_online.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -905,8 +905,7 @@ def test_retrieve_online_milvus_documents(environment, fake_document_data):
905905
item_embeddings_feature_view = create_item_embeddings_feature_view(data_source)
906906
fs.apply([item_embeddings_feature_view, item()])
907907
fs.write_to_online_store("item_embeddings", df)
908-
documents = fs.retrieve_online_documents(
909-
feature=None,
908+
documents = fs.retrieve_online_documents_v2(
910909
features=[
911910
"item_embeddings:embedding_float",
912911
"item_embeddings:item_id",

0 commit comments

Comments
 (0)