Skip to content

Commit 6531685

Browse files
achalsadchia
authored andcommitted
fix: Support push sources in stream feature views (#2704)
Signed-off-by: Achal Shah <[email protected]>
1 parent 00a9de9 commit 6531685

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

sdk/python/feast/stream_feature_view.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
from feast.field import Field
88
from feast.protos.feast.core.DataSource_pb2 import DataSource as DataSourceProto
99

10-
SUPPORTED_STREAM_SOURCES = {
11-
"KafkaSource",
12-
"KinesisSource",
13-
}
10+
SUPPORTED_STREAM_SOURCES = {"KafkaSource", "KinesisSource", "PushSource"}
1411

1512

1613
class StreamFeatureView(FeatureView):

sdk/python/tests/unit/test_feature_views.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import pytest
44

5+
from feast import PushSource
56
from feast.batch_feature_view import BatchFeatureView
67
from feast.data_format import AvroFormat
78
from feast.data_source import KafkaSource
@@ -50,12 +51,22 @@ def test_create_stream_feature_view():
5051
batch_source=FileSource(path="some path"),
5152
)
5253
StreamFeatureView(
53-
name="test batch feature view",
54+
name="test kafka stream feature view",
5455
entities=[],
5556
ttl=timedelta(days=30),
5657
source=stream_source,
5758
)
5859

60+
push_source = PushSource(
61+
name="push source", batch_source=FileSource(path="some path")
62+
)
63+
StreamFeatureView(
64+
name="test push source feature view",
65+
entities=[],
66+
ttl=timedelta(days=30),
67+
source=push_source,
68+
)
69+
5970
with pytest.raises(ValueError):
6071
StreamFeatureView(
6172
name="test batch feature view", entities=[], ttl=timedelta(days=30)

0 commit comments

Comments
 (0)