josh-fell commented on PR #25604:
URL: https://github.com/apache/airflow/pull/25604#issuecomment-1215593015

   > Hmm, the static check failures raise a point for discussion. XComArg has 
an (unfortunate) API design `xcom_arg[key]` that can be used to pull an XCom 
under a different key, but I’m not sure I like it being used with `output`. 
`task.output["foo"]` feel to me more like accessing a dict, not pulling another 
XCom. The API design can be discussed/changed later, but here I think we should 
decide whether that is a usage we want to encourage or not (personally I’m 
against).
   
   I have the same icky feeling with that current syntax as well. It's also not 
functionally equivalent to the classic `ti.xcom_pull(task_id=..., 
key=...)["some_item"]` which I [opened an issue about last 
year](https://github.com/apache/airflow/issues/16618). There was some 
discussion on what to change the API to, but there was also a little of "that 
ship has sailed" vibe too. Since this is coming up again, it's probably time to 
raise a discussion about it on the dev list.
   
   In the meantime, WDYT about allowing `operator.output(key=...)`? It's 
functionally possible to pass in a `key` arg to `XComArg` already, the syntax 
isn't too bad, and has a less confusing API than the current one. I'm happy to 
work on this if it's happy middle ground.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to