Skip to content

Commit

Permalink
add tests, small utils fix
Browse files Browse the repository at this point in the history
Signed-off-by: Tommy Hughes <tohughes@redhat.com>
  • Loading branch information
tchughesiv committed Jun 17, 2024
1 parent 560c233 commit 26135e8
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def test_apply_feature_view_success(test_registry):
# Register Feature View
test_registry.apply_feature_view(fv1, project)

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

# List Feature Views
assert (
Expand Down Expand Up @@ -397,14 +397,14 @@ def test_apply_feature_view_success(test_registry):
# Modify the feature view and apply again to test if diffing the online store table works
fv1.ttl = timedelta(minutes=6)
test_registry.apply_feature_view(fv1, project)
feature_views = test_registry.list_batch_feature_views(project)
feature_views = test_registry.list_feature_views(project)
assert len(feature_views) == 1
feature_view = test_registry.get_feature_view("my_feature_view_1", project)
assert feature_view.ttl == timedelta(minutes=6)

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

test_registry.teardown()
Expand Down Expand Up @@ -530,7 +530,7 @@ def test_apply_data_source(test_registry):
test_registry.apply_data_source(batch_source, project, commit=False)
test_registry.apply_feature_view(fv1, project, commit=True)

registry_feature_views = test_registry.list_batch_feature_views(
registry_feature_views = test_registry.list_feature_views(
project, tags=fv1.tags
)
registry_data_sources = test_registry.list_data_sources(project)
Expand All @@ -545,7 +545,7 @@ def test_apply_data_source(test_registry):
batch_source.timestamp_field = "new_ts_col"
test_registry.apply_data_source(batch_source, project, commit=False)
test_registry.apply_feature_view(fv1, project, commit=True)
registry_feature_views = test_registry.list_batch_feature_views(
registry_feature_views = test_registry.list_feature_views(
project, tags=fv1.tags
)
registry_data_sources = test_registry.list_data_sources(project)
Expand Down Expand Up @@ -660,7 +660,7 @@ def odfv1(feature_df: pd.DataFrame) -> pd.DataFrame:
)

# Make sure fv1 is untouched
feature_views = test_registry.list_batch_feature_views(project, tags=fv1.tags)
feature_views = test_registry.list_feature_views(project, tags=fv1.tags)

# List Feature Views
assert (
Expand Down Expand Up @@ -751,7 +751,7 @@ def test_registry_cache(test_registry):
# Register data source and feature view
test_registry.apply_data_source(batch_source, project)
test_registry.apply_feature_view(fv1, project)
registry_feature_views_cached = test_registry.list_batch_feature_views(
registry_feature_views_cached = test_registry.list_feature_views(
project, allow_cache=True
)
registry_data_sources_cached = test_registry.list_data_sources(
Expand All @@ -762,7 +762,7 @@ def test_registry_cache(test_registry):
assert len(registry_data_sources_cached) == 0
test_registry.refresh(project)
# Now objects exist
registry_feature_views_cached = test_registry.list_batch_feature_views(
registry_feature_views_cached = test_registry.list_feature_views(
project, allow_cache=True, tags=fv1.tags
)
registry_data_sources_cached = test_registry.list_data_sources(
Expand Down

0 comments on commit 26135e8

Please sign in to comment.