uranusjr commented on code in PR #41097:
URL: https://github.com/apache/airflow/pull/41097#discussion_r1696527424


##########
airflow/models/dataset.py:
##########
@@ -124,6 +128,15 @@ def from_public(cls, obj: DatasetAlias) -> 
DatasetAliasModel:
     def __repr__(self):
         return f"{self.__class__.__name__}(name={self.name!r})"
 
+    def __hash__(self):
+        return hash(self.name)
+
+    def __eq__(self, other):
+        if isinstance(other, (self.__class__, DatasetAlias)):
+            return self.name == other.name
+        else:
+            return NotImplemented

Review Comment:
   Not sure what I feel about implementing these on a SQLAlchemy class. 
Probably doable? We should find some resource on if these are OK.
   
   Or we could instead just use a dict instead (using the name as key).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to