Skip to content

Commit

Permalink
fix: Support push sources in stream feature views (#2704)
Browse files Browse the repository at this point in the history
Signed-off-by: Achal Shah <achals@gmail.com>
  • Loading branch information
achals authored and adchia committed May 16, 2022
1 parent 00a9de9 commit 6531685
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
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

0 comments on commit 6531685

Please sign in to comment.