diff --git a/sdk/python/feast/data_source.py b/sdk/python/feast/data_source.py index 6ab7934371b..a1e44b3186f 100644 --- a/sdk/python/feast/data_source.py +++ b/sdk/python/feast/data_source.py @@ -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 "" diff --git a/sdk/python/tests/unit/test_data_sources.py b/sdk/python/tests/unit/test_data_sources.py index 61891ccf1a4..0b437e50b94 100644 --- a/sdk/python/tests/unit/test_data_sources.py +++ b/sdk/python/tests/unit/test_data_sources.py @@ -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", + )