Skip to content
Merged
Show file tree
Hide file tree
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
Add proto conversion test for KafkaSource
Signed-off-by: Felix Wang <wangfelix98@gmail.com>
  • Loading branch information
felixwang9817 committed Apr 23, 2022
commit d0175dafafae1751a8602e8d0c4a9db2f8e5f440
2 changes: 1 addition & 1 deletion sdk/python/feast/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ def __init__(

if _message_format is None:
raise ValueError("Message format must be specified for Kafka source")
print("Asdfasdf")

super().__init__(
event_timestamp_column=_event_timestamp_column,
created_timestamp_column=created_timestamp_column,
Expand Down
15 changes: 15 additions & 0 deletions sdk/python/tests/unit/test_data_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,18 @@ def test_proto_conversion():
assert DataSource.from_proto(file_source.to_proto()) == file_source
assert DataSource.from_proto(redshift_source.to_proto()) == redshift_source
assert DataSource.from_proto(snowflake_source.to_proto()) == snowflake_source

kafka_source = KafkaSource(
name="test_source",
bootstrap_servers="test_servers",
message_format=ProtoFormat("class_path"),
topic="test_topic",
timestamp_field="event_timestamp",
created_timestamp_column="created_timestamp",
field_mapping={"foo": "bar"},
description="test description",
owner="test@gmail.com",
batch_source=file_source,
)

assert DataSource.from_proto(kafka_source.to_proto()) == kafka_source