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
Adding integration for feature view with no source
Signed-off-by: Nick Quinn <nicholas_quinn@apple.com>
  • Loading branch information
nickquinn408 authored and ntkathole committed Mar 10, 2026
commit df4c9e871234441f2dea5f74aa8ff508a9a994a5
1 change: 1 addition & 0 deletions sdk/python/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ markers =
slow: Tests taking >30 seconds
cloud: Tests requiring cloud credentials
local_only: Tests that run entirely locally
xdist_group: Group tests to run in the same xdist worker

timeout = 300
timeout_method = thread
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,83 @@ def test_apply_feature_view_success(test_registry: BaseRegistry):
test_registry.teardown()


@pytest.mark.integration
@pytest.mark.parametrize(
"test_registry",
all_fixtures,
)
def test_apply_feature_view_without_source_success(test_registry: BaseRegistry):
"""Test that a FeatureView with no source can be applied, retrieved, updated, and deleted."""
entity = Entity(name="fs1_my_entity_1", join_keys=["test"])

fv1 = FeatureView(
name="my_feature_view_no_source",
schema=[
Field(name="test", dtype=Int64),
Field(name="fs1_my_feature_1", dtype=Int64),
Field(name="fs1_my_feature_2", dtype=String),
Field(name="fs1_my_feature_3", dtype=Array(String)),
],
entities=[entity],
tags={"team": "matchmaking"},
source=None,
ttl=timedelta(minutes=5),
)

project = "project"

# Register Feature View
test_registry.apply_feature_view(fv1, project)

feature_views = test_registry.list_feature_views(project, tags=fv1.tags)

assert len(feature_views) == 1
assert feature_views[0].name == "my_feature_view_no_source"
assert feature_views[0].batch_source is None
assert feature_views[0].stream_source is None
assert feature_views[0].features[0].name == "fs1_my_feature_1"
assert feature_views[0].features[0].dtype == Int64
assert feature_views[0].features[1].name == "fs1_my_feature_2"
assert feature_views[0].features[1].dtype == String
assert feature_views[0].features[2].name == "fs1_my_feature_3"
assert feature_views[0].features[2].dtype == Array(String)

feature_view = test_registry.get_feature_view("my_feature_view_no_source", project)
any_feature_view = test_registry.get_any_feature_view(
"my_feature_view_no_source", project
)

assert feature_view.name == "my_feature_view_no_source"
assert feature_view.batch_source is None
assert feature_view.stream_source is None
assert feature_view.ttl == timedelta(minutes=5)
assert feature_view == any_feature_view

# After the first apply, created_timestamp should equal last_updated_timestamp.
assert feature_view.created_timestamp == feature_view.last_updated_timestamp

# Update the feature view and verify created_timestamp is preserved.
fv1.ttl = timedelta(minutes=10)
test_registry.apply_feature_view(fv1, project)
feature_views = test_registry.list_feature_views(project)
assert len(feature_views) == 1
updated_feature_view = test_registry.get_feature_view(
"my_feature_view_no_source", project
)
assert updated_feature_view.ttl == timedelta(minutes=10)
assert updated_feature_view.batch_source is None
assert (
updated_feature_view.created_timestamp == feature_view.created_timestamp
)

# Delete the feature view.
test_registry.delete_feature_view("my_feature_view_no_source", project)
feature_views = test_registry.list_feature_views(project)
assert len(feature_views) == 0

test_registry.teardown()


@pytest.mark.integration
@pytest.mark.parametrize(
"test_registry",
Expand Down