Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Support push sources in stream feature views #2704

Merged
merged 1 commit into from
May 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 1 addition & 4 deletions sdk/python/feast/stream_feature_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
from feast.field import Field
from feast.protos.feast.core.DataSource_pb2 import DataSource as DataSourceProto

SUPPORTED_STREAM_SOURCES = {
"KafkaSource",
"KinesisSource",
}
SUPPORTED_STREAM_SOURCES = {"KafkaSource", "KinesisSource", "PushSource"}


class StreamFeatureView(FeatureView):
Expand Down
13 changes: 12 additions & 1 deletion sdk/python/tests/unit/test_feature_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import pytest

from feast import PushSource
from feast.batch_feature_view import BatchFeatureView
from feast.data_format import AvroFormat
from feast.data_source import KafkaSource
Expand Down Expand Up @@ -50,12 +51,22 @@ def test_create_stream_feature_view():
batch_source=FileSource(path="some path"),
)
StreamFeatureView(
name="test batch feature view",
name="test kafka stream feature view",
entities=[],
ttl=timedelta(days=30),
source=stream_source,
)

push_source = PushSource(
name="push source", batch_source=FileSource(path="some path")
)
StreamFeatureView(
name="test push source feature view",
entities=[],
ttl=timedelta(days=30),
source=push_source,
)

with pytest.raises(ValueError):
StreamFeatureView(
name="test batch feature view", entities=[], ttl=timedelta(days=30)
Expand Down