mpeteuil commented on code in PR #37465:
URL: https://github.com/apache/airflow/pull/37465#discussion_r1497609428


##########
airflow/datasets/__init__.py:
##########
@@ -46,3 +46,12 @@ def _check_uri(self, attr, uri: str):
 
     def __fspath__(self):
         return self.uri
+
+    def __eq__(self, other):
+        if isinstance(other, self.__class__):
+            return self.uri == other.uri
+        else:
+            return NotImplemented
+
+    def __hash__(self):
+        return hash(self.uri)

Review Comment:
   Thanks @Taragolis, I thought about that too. I think in this case because a 
`Dataset` URI uniquely identifies a `Dataset` using `extra` doesn't need to be 
a consideration. [There's even a unique index on the 
`DatasetModel`](https://github.com/apache/airflow/blob/dec78ab3f140f35e507de825327652ec24d03522/airflow/models/dataset.py#L74-L77)
 enforcing URI uniqueness.



-- 
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