Skip to content

Commit cd8f1c9

Browse files
committed
fix: Fix unhashable Snowflake and Redshift sources
Signed-off-by: Willem Pienaar <git@willem.co>
1 parent 21c1b6f commit cd8f1c9

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

sdk/python/feast/infra/offline_stores/redshift_source.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ def from_proto(data_source: DataSourceProto):
9090
query=data_source.redshift_options.query,
9191
)
9292

93+
# Note: Python requires redefining hash in child classes that override __eq__
94+
def __hash__(self):
95+
return super().__hash__()
96+
9397
def __eq__(self, other):
9498
if not isinstance(other, RedshiftSource):
9599
raise TypeError(

sdk/python/feast/infra/offline_stores/snowflake_source.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ def from_proto(data_source: DataSourceProto):
9191
query=data_source.snowflake_options.query,
9292
)
9393

94+
# Note: Python requires redefining hash in child classes that override __eq__
95+
def __hash__(self):
96+
return super().__hash__()
97+
9498
def __eq__(self, other):
9599
if not isinstance(other, SnowflakeSource):
96100
raise TypeError(

0 commit comments

Comments
 (0)