Skip to content
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
7 changes: 7 additions & 0 deletions sdk/python/feast/data_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,13 @@ def __init__(
),
DeprecationWarning,
)
if (
self.timestamp_field
and self.timestamp_field == self.created_timestamp_column
):
raise ValueError(
"Please do not use the same column for 'timestamp_field' and 'created_timestamp_column'."
)
self.description = description or ""
self.tags = tags or {}
self.owner = owner or ""
Expand Down
10 changes: 10 additions & 0 deletions sdk/python/tests/unit/test_data_sources.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,3 +261,13 @@ def test_proto_conversion():
assert DataSource.from_proto(kinesis_source.to_proto()) == kinesis_source
assert DataSource.from_proto(push_source.to_proto()) == push_source
assert DataSource.from_proto(request_source.to_proto()) == request_source


def test_column_conflict():
with pytest.raises(ValueError):
_ = FileSource(
name="test_source",
path="test_path",
timestamp_field="event_timestamp",
created_timestamp_column="event_timestamp",
)