Skip to content

Commit

Permalink
DTREX-613 Adds an unit test for `amora.feature_store.registry.get_fea…
Browse files Browse the repository at this point in the history
…ture_service` (#82)

* DTREX-613 Adds an unit test for `amora.feature_store.registry.get_feature_service`

* 0.1.10rc3
  • Loading branch information
diogommartins committed May 3, 2022
1 parent 2129cbd commit 37035bf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "amora"
version = "0.1.10rc2"
version = "0.1.10rc3"
description = "Amora Data Build Tool"
authors = ["diogommartins <diogo.martins@stone.com.br>"]
license = "MIT"
Expand Down
14 changes: 13 additions & 1 deletion tests/feature_store/test_registry.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
from datetime import datetime

import pytest
from feast import Feature, ValueType, FeatureView, Entity
from feast import Feature, ValueType, FeatureView, Entity, FeatureService
from amora.feature_store import registry
from amora.feature_store.decorators import feature_view
from amora.feature_store.feature_view import name_for_model
from amora.models import AmoraModel, Field
from tests.models.step_count_by_source import StepCountBySource


def test_get_repo_contents():
Expand Down Expand Up @@ -55,3 +56,14 @@ def feature_view_event_timestamp(cls) -> str:
pytest.fail(
f"{expected_fv_name} not found in Feast's RepoContents. Repo feature views: {repo_contents.feature_views}"
)


def test_get_feature_service():
feature_service = registry.get_feature_service(StepCountBySource)

assert isinstance(feature_service, FeatureService)
assert feature_service.name == "amora_fs__step_count_by_source"
assert len(feature_service.feature_view_projections) == 1

feature_view_projection = feature_service.feature_view_projections[0]
assert feature_view_projection.name == StepCountBySource.__tablename__

0 comments on commit 37035bf

Please sign in to comment.