Skip to content

Commit 72add32

Browse files
formatted and updated test
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
1 parent c4ebf18 commit 72add32

2 files changed

Lines changed: 9 additions & 17 deletions

File tree

sdk/python/feast/feature_store.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ def apply(
888888
):
889889
if isinstance(fv, FeatureView):
890890
data_sources_set_to_update.add(fv.batch_source)
891-
if hasattr(fv, 'stream_source'):
891+
if hasattr(fv, "stream_source"):
892892
if fv.stream_source:
893893
data_sources_set_to_update.add(fv.stream_source)
894894
if isinstance(fv, OnDemandFeatureView):

sdk/python/tests/unit/local_feast_tests/test_local_feature_store.py

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -359,27 +359,22 @@ def test_apply_dummy_entity_and_feature_view_columns(test_feature_store):
359359

360360
e1 = Entity(name="fs1_my_entity_1", description="something")
361361

362-
fv_with_entity = FeatureView(
363-
name="my_feature_view_with_entity",
362+
fv_no_entity = FeatureView(
363+
name="my_feature_view_no_entity",
364364
schema=[
365365
Field(name="fs1_my_feature_1", dtype=Int64),
366-
Field(name="fs1_my_feature_2", dtype=String),
367-
Field(name="fs1_my_feature_3", dtype=Array(String)),
368-
Field(name="fs1_my_feature_4", dtype=Array(Bytes)),
369-
Field(name="fs1_my_entity_1", dtype=Int64),
370366
],
371-
entities=[e1],
367+
entities=[],
372368
tags={"team": "matchmaking"},
373369
source=batch_source,
374370
ttl=timedelta(minutes=5),
375371
)
376-
377-
fv_no_entity = FeatureView(
378-
name="my_feature_view_no_entity",
372+
fv_with_entity = FeatureView(
373+
name="my_feature_view_with_entity",
379374
schema=[
380375
Field(name="fs1_my_feature_1", dtype=Int64),
381376
],
382-
entities=[],
377+
entities=[e1],
383378
tags={"team": "matchmaking"},
384379
source=batch_source,
385380
ttl=timedelta(minutes=5),
@@ -388,22 +383,19 @@ def test_apply_dummy_entity_and_feature_view_columns(test_feature_store):
388383
# Check that the entity_columns are empty before applying
389384
assert fv_no_entity.entities == [DUMMY_ENTITY_NAME]
390385
assert fv_no_entity.entity_columns == []
391-
assert fv_with_entity.entity_columns[0].name == e1.name
386+
assert fv_with_entity.entity_columns == []
392387

393388
# Register Feature View
394-
test_feature_store.apply([e1, fv_no_entity, fv_with_entity])
389+
test_feature_store.apply([e1, fv_no_entity])
395390
fv_from_online_store = test_feature_store.get_feature_view(
396391
"my_feature_view_no_entity"
397392
)
398-
399393
# Note that after the apply() the feature_view serializes the Dummy Entity ID
400394
assert fv_no_entity.entity_columns[0].name == DUMMY_ENTITY_ID
401395
assert fv_from_online_store.entity_columns[0].name == DUMMY_ENTITY_ID
402396
assert fv_from_online_store.entities == []
403397
assert fv_no_entity.entities == [DUMMY_ENTITY_NAME]
404398

405-
assert fv_with_entity.entity_columns[0].name == e1.name
406-
assert fv_with_entity.entities == [e1.name]
407399
test_feature_store.teardown()
408400

409401

0 commit comments

Comments
 (0)