Skip to content

Commit 3dd885f

Browse files
committed
Fix Python consolidator equality
1 parent 1919dbc commit 3dd885f

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Common/Python/DataConsolidatorPythonWrapper.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,22 @@ public void Dispose()
112112
{
113113
_pythonWrapper.Dispose();
114114
}
115+
116+
/// <summary>
117+
/// Two wrappers are equal if they wrap the same Python object reference.
118+
/// </summary>
119+
public override bool Equals(object obj)
120+
{
121+
if (obj is DataConsolidatorPythonWrapper other)
122+
{
123+
return _pythonWrapper.Equals(other._pythonWrapper);
124+
}
125+
return _pythonWrapper.Equals(obj);
126+
}
127+
128+
/// <summary>
129+
/// Hash code based on the underlying Python object reference.
130+
/// </summary>
131+
public override int GetHashCode() => _pythonWrapper.GetHashCode();
115132
}
116133
}

0 commit comments

Comments
 (0)