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


##########
airflow/models/xcom_arg.py:
##########
@@ -255,6 +255,9 @@ def __getitem__(self, item: str) -> XComArg:
             raise ValueError(f"XComArg only supports str lookup, received 
{type(item).__name__}")
         return PlainXComArg(operator=self.operator, key=item)
 
+    def __hash__(self) -> int:
+        return hash((self.operator.task_id, self.key))

Review Comment:
   I don’t think just these two are enough? This will pass:
   
   ```python
   arg = XComArg(op)
   asset hash(arg) == hash(arg.map(lambda x: x * 2))
   ```
   
   Those subclasses are also why the (de)serialisation methods are private and 
you should use the free functions instead.



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