GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: Return False from __eq__ on cross-type comparison by larrysingleton007 · Pull Request #6637 · feast-dev/feast

fix: Return False from __eq__ on cross-type comparison #6637

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
ntkathole merged 3 commits into feast-dev:master from larrysingleton007:fix/eq-cross-type-comparison
Jul 30, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

fix: Return False from __eq__ on cross-type comparison #6637

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
3 commits
Select commit Hold shift + click to select a range
24e21bf
fix: Return False from __eq__ on cross-type comparison
larrysingleton007 Jul 23, 2026
3d5a6df
test: Add parametrized cross-type __eq__ coverage across the object m…
larrysingleton007 Jul 23, 2026
d2fc30b
fix: Guard SparkSource, Feature, and data format __eq__ against cross…
larrysingleton007 Jul 28, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

2 changes: 1 addition & 1 deletion 2 sdk/python/feast/aggregation/__init__.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def from_proto(cls, agg_proto: AggregationProto):

def __eq__(self, other):
if not isinstance(other, Aggregation):
raise TypeError("Comparisons should only involve Aggregations.")
return False

if (
self.column != other.column
Expand Down
4 changes: 1 addition & 3 deletions 4 sdk/python/feast/base_feature_view.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,7 @@ def _schema_or_udf_changed(self, other: "BaseFeatureView") -> bool:

def __eq__(self, other):
if not isinstance(other, BaseFeatureView):
raise TypeError(
"Comparisons should only involve BaseFeatureView class objects."
)
return False

if (
self.name != other.name
Expand Down
4 changes: 4 additions & 0 deletions 4 sdk/python/feast/data_format.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ def to_proto(self):
pass

def __eq__(self, other):
if not isinstance(other, FileFormat):
return False
return self.to_proto() == other.to_proto()

@classmethod
Expand Down Expand Up @@ -95,6 +97,8 @@ def to_proto(self):
pass

def __eq__(self, other):
if not isinstance(other, StreamFormat):
return False
return self.to_proto() == other.to_proto()

@classmethod
Expand Down
14 changes: 4 additions & 10 deletions 14 sdk/python/feast/data_source.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def __eq__(self, other):
return False

if not isinstance(other, DataSource):
raise TypeError("Comparisons should only involve DataSource class objects.")
return False

if (
self.name != other.name
Expand Down Expand Up @@ -499,9 +499,7 @@ def __init__(

def __eq__(self, other):
if not isinstance(other, KafkaSource):
raise TypeError(
"Comparisons should only involve KafkaSource class objects."
)
return False

if not super().__eq__(other):
return False
Expand Down Expand Up @@ -639,9 +637,7 @@ def get_table_column_names_and_types(

def __eq__(self, other):
if not isinstance(other, RequestSource):
raise TypeError(
"Comparisons should only involve RequestSource class objects."
)
return False

if not super().__eq__(other):
return False
Expand Down Expand Up @@ -801,9 +797,7 @@ def __init__(

def __eq__(self, other):
if not isinstance(other, KinesisSource):
raise TypeError(
"Comparisons should only involve KinesisSource class objects."
)
return False

if not super().__eq__(other):
return False
Expand Down
2 changes: 1 addition & 1 deletion 2 sdk/python/feast/entity.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def __hash__(self) -> int:

def __eq__(self, other):
if not isinstance(other, Entity):
raise TypeError("Comparisons should only involve Entity class objects.")
return False

if (
self.name != other.name
Expand Down
2 changes: 2 additions & 0 deletions 2 sdk/python/feast/feature.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def __init__(
self._labels = labels

def __eq__(self, other):
if not isinstance(other, Feature):
return False
if self.name != other.name or self.dtype != other.dtype:
return False
return True
Expand Down
4 changes: 1 addition & 3 deletions 4 sdk/python/feast/feature_service.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,7 @@ def __hash__(self):

def __eq__(self, other):
if not isinstance(other, FeatureService):
raise TypeError(
"Comparisons should only involve FeatureService class objects."
)
return False

if (
self.name != other.name
Expand Down
4 changes: 1 addition & 3 deletions 4 sdk/python/feast/feature_view.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,7 @@ def _schema_or_udf_changed(self, other: "BaseFeatureView") -> bool:

def __eq__(self, other):
if not isinstance(other, FeatureView):
raise TypeError(
"Comparisons should only involve FeatureView class objects."
)
return False

if not super().__eq__(other):
return False
Expand Down
4 changes: 1 addition & 3 deletions 4 sdk/python/feast/infra/offline_stores/bigquery_source.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ def __hash__(self):

def __eq__(self, other):
if not isinstance(other, BigQuerySource):
raise TypeError(
"Comparisons should only involve BigQuerySource class objects."
)
return False

return (
super().__eq__(other)
Expand Down
4 changes: 1 addition & 3 deletions 4 sdk/python/feast/infra/offline_stores/contrib/athena_offline_store/athena_source.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,7 @@ def __hash__(self):

def __eq__(self, other):
if not isinstance(other, AthenaSource):
raise TypeError(
"Comparisons should only involve AthenaSource class objects."
)
return False

return (
super().__eq__(other)
Expand Down
4 changes: 1 addition & 3 deletions 4 sdk/python/feast/infra/offline_stores/contrib/couchbase_offline_store/couchbase_source.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ def __hash__(self):

def __eq__(self, other):
if not isinstance(other, CouchbaseColumnarSource):
raise TypeError(
"Comparisons should only involve CouchbaseColumnarSource class objects."
)
return False

return (
super().__eq__(other)
Expand Down
4 changes: 1 addition & 3 deletions 4 sdk/python/feast/infra/offline_stores/contrib/mssql_offline_store/mssqlserver_source.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,7 @@ def __init__(

def __eq__(self, other):
if not isinstance(other, MsSqlServerSource):
raise TypeError(
"Comparisons should only involve SqlServerSource class objects."
)
return False

return (
self.name == other.name
Expand Down
4 changes: 1 addition & 3 deletions 4 sdk/python/feast/infra/offline_stores/contrib/oracle_offline_store/oracle_source.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,7 @@ def __init__(

def __eq__(self, other):
if not isinstance(other, OracleSource):
raise TypeError(
"Comparisons should only involve OracleSource class objects."
)
return False

return (
self.name == other.name
Expand Down
4 changes: 1 addition & 3 deletions 4 sdk/python/feast/infra/offline_stores/contrib/postgres_offline_store/postgres_source.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ def __hash__(self):

def __eq__(self, other):
if not isinstance(other, PostgreSQLSource):
raise TypeError(
"Comparisons should only involve PostgreSQLSource class objects."
)
return False

return (
super().__eq__(other)
Expand Down
2 changes: 1 addition & 1 deletion 2 sdk/python/feast/infra/offline_stores/contrib/ray_offline_store/ray_source.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def get_table_query_string(self) -> str:

def __eq__(self, other):
if not isinstance(other, RaySource):
raise TypeError("Comparisons should only involve RaySource class objects.")
return False
base_eq = super().__eq__(other)
if not base_eq:
return False
Expand Down
9 changes: 7 additions & 2 deletions 9 sdk/python/feast/infra/offline_stores/contrib/spark_offline_store/spark_source.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,13 @@ def _load_dataframe_from_path(self, spark_session):
return reader.load(self.path)

def __eq__(self, other):
base_eq = super().__eq__(other)
if not base_eq:
# Guard before the spark-specific attribute access below: the base
# DataSource.__eq__ accepts any DataSource subclass, so a cross-type
# comparison (e.g. against a FileSource with a matching name) would
# otherwise raise AttributeError on `other.table` (#6636).
if not isinstance(other, SparkSource):
return False
if not super().__eq__(other):
return False
return (
self.table == other.table
Expand Down
4 changes: 1 addition & 3 deletions 4 sdk/python/feast/infra/offline_stores/contrib/trino_offline_store/trino_source.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ def __hash__(self):

def __eq__(self, other):
if not isinstance(other, TrinoSource):
raise TypeError(
"Comparisons should only involve TrinoSource class objects."
)
return False

return (
super().__eq__(other)
Expand Down
2 changes: 1 addition & 1 deletion 2 sdk/python/feast/infra/offline_stores/file_source.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def __hash__(self):

def __eq__(self, other):
if not isinstance(other, FileSource):
raise TypeError("Comparisons should only involve FileSource class objects.")
return False

return (
super().__eq__(other)
Expand Down
4 changes: 1 addition & 3 deletions 4 sdk/python/feast/infra/offline_stores/redshift_source.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ def __hash__(self):

def __eq__(self, other):
if not isinstance(other, RedshiftSource):
raise TypeError(
"Comparisons should only involve RedshiftSource class objects."
)
return False

return (
super().__eq__(other)
Expand Down
4 changes: 1 addition & 3 deletions 4 sdk/python/feast/infra/offline_stores/snowflake_source.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ def __hash__(self):

def __eq__(self, other):
if not isinstance(other, SnowflakeSource):
raise TypeError(
"Comparisons should only involve SnowflakeSource class objects."
)
return False

return (
super().__eq__(other)
Expand Down
2 changes: 1 addition & 1 deletion 2 sdk/python/feast/labeling/label_view.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def __copy__(self):

def __eq__(self, other):
if not isinstance(other, LabelView):
raise TypeError("Comparisons should only involve LabelView class objects.")
return False

if not super().__eq__(other):
return False
Expand Down
4 changes: 1 addition & 3 deletions 4 sdk/python/feast/on_demand_feature_view.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,7 @@ def _schema_or_udf_changed(self, other: "BaseFeatureView") -> bool:

def __eq__(self, other):
if not isinstance(other, OnDemandFeatureView):
raise TypeError(
"Comparisons should only involve OnDemandFeatureView class objects."
)
return False

# Note, no longer evaluating the base feature view layer as ODFVs can have
# multiple datasources and a base_feature_view only has one source
Expand Down
2 changes: 1 addition & 1 deletion 2 sdk/python/feast/permissions/permission.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __init__(

def __eq__(self, other):
if not isinstance(other, Permission):
raise TypeError("Comparisons should only involve Permission class objects.")
return False

if (
self.name != other.name
Expand Down
16 changes: 4 additions & 12 deletions 16 sdk/python/feast/permissions/policy.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ def __init__(

def __eq__(self, other):
if not isinstance(other, RoleBasedPolicy):
raise TypeError(
"Comparisons should only involve RoleBasedPolicy class objects."
)
return False

if sorted(self.roles) != sorted(other.roles):
return False
Expand Down Expand Up @@ -148,9 +146,7 @@ def __init__(

def __eq__(self, other):
if not isinstance(other, GroupBasedPolicy):
raise TypeError(
"Comparisons should only involve GroupBasedPolicy class objects."
)
return False

if sorted(self.groups) != sorted(other.groups):
return False
Expand Down Expand Up @@ -206,9 +202,7 @@ def __init__(

def __eq__(self, other):
if not isinstance(other, NamespaceBasedPolicy):
raise TypeError(
"Comparisons should only involve NamespaceBasedPolicy class objects."
)
return False

if sorted(self.namespaces) != sorted(other.namespaces):
return False
Expand Down Expand Up @@ -270,9 +264,7 @@ def __init__(

def __eq__(self, other):
if not isinstance(other, CombinedGroupNamespacePolicy):
raise TypeError(
"Comparisons should only involve CombinedGroupNamespacePolicy class objects."
)
return False

if sorted(self.groups) != sorted(other.groups) or sorted(
self.namespaces
Expand Down
2 changes: 1 addition & 1 deletion 2 sdk/python/feast/project.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __hash__(self) -> int:

def __eq__(self, other):
if not isinstance(other, Project):
raise TypeError("Comparisons should only involve Project class objects.")
return False

if (
self.name != other.name
Expand Down
4 changes: 1 addition & 3 deletions 4 sdk/python/feast/project_metadata.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ def __hash__(self) -> int:

def __eq__(self, other):
if not isinstance(other, ProjectMetadata):
raise TypeError(
"Comparisons should only involve ProjectMetadata class objects."
)
return False

if (
self.project_name != other.project_name
Expand Down
4 changes: 1 addition & 3 deletions 4 sdk/python/feast/saved_dataset.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@ def __hash__(self):

def __eq__(self, other):
if not isinstance(other, SavedDataset):
raise TypeError(
"Comparisons should only involve SavedDataset class objects."
)
return False

if (
self.name != other.name
Expand Down
2 changes: 1 addition & 1 deletion 2 sdk/python/feast/stream_feature_view.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def _schema_or_udf_changed(self, other: "BaseFeatureView") -> bool:

def __eq__(self, other):
if not isinstance(other, StreamFeatureView):
raise TypeError("Comparisons should only involve StreamFeatureViews")
return False

if not super().__eq__(other):
return False
Expand Down
4 changes: 1 addition & 3 deletions 4 sdk/python/feast/transformation/pandas_transformation.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,7 @@ def infer_features(

def __eq__(self, other):
if not isinstance(other, PandasTransformation):
raise TypeError(
"Comparisons should only involve PandasTransformation class objects."
)
return False

if (
self.udf_string != other.udf_string
Expand Down
4 changes: 1 addition & 3 deletions 4 sdk/python/feast/transformation/python_transformation.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@ def infer_features(

def __eq__(self, other):
if not isinstance(other, PythonTransformation):
raise TypeError(
"Comparisons should only involve PythonTransformation class objects."
)
return False

if (
self.udf_string != other.udf_string
Expand Down
4 changes: 1 addition & 3 deletions 4 sdk/python/feast/transformation/ray_transformation.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,7 @@ def infer_features(

def __eq__(self, other):
if not isinstance(other, RayTransformation):
raise TypeError(
"Comparisons should only involve RayTransformation class objects."
)
return False

if (
self.udf_string != other.udf_string
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.