Skip to content
Merged
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
Fix lint
Signed-off-by: Kevin Zhang <kzhang@tecton.ai>
  • Loading branch information
kevjumba committed Apr 19, 2022
commit 3b40bd9cebc3dfae3442e87501a80a8a6547ed1b
15 changes: 5 additions & 10 deletions sdk/python/tests/unit/test_feature_service.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import pytest

from feast.feature_service import FeatureService
from feast.feature_view import FeatureView
from feast.field import Field
from feast.infra.offline_stores.file_source import FileSource
from feast.types import Float32
import pytest


def test_feature_service_with_description():
Expand Down Expand Up @@ -61,21 +62,15 @@ def test_hash():
def test_feature_view_kw_args_warning():
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a test for the kwargs version not raising any deprecation warnings?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

# source_class = request.param
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rm?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

with pytest.warns(DeprecationWarning):
service = FeatureService(
"name", [], tags = {"tag_1": "tag"}, description="desc"
)
service = FeatureService("name", [], tags={"tag_1": "tag"}, description="desc")
assert service.name == "name"
assert service.tags == {"tag_1": "tag"}
assert service.description == "desc"

# More positional args than name and features
with pytest.raises(ValueError):
service = FeatureService(
"name", [], {"tag_1": "tag"}, "desc"
)
service = FeatureService("name", [], {"tag_1": "tag"}, "desc")

# No name defined.
with pytest.raises(ValueError):
service = FeatureService(
features=[], tags={"tag_1": "tag"}, description="desc"
)
service = FeatureService(features=[], tags={"tag_1": "tag"}, description="desc")