ashb commented on issue #16618:
URL: https://github.com/apache/airflow/issues/16618#issuecomment-876288276


   Hmmm, the "native" way I would like this to work is:
   
   ```python
   my_op.output['dataflow_job_id']
   # Ideal, would be equivalent. to 
my_op.xcom_pull(key='return_value')['dataflow_job_id']
   ```
   
   But sadly XComArg already has a `__getitem__` to override the key, which 
means it is actually 
   
   ```python
   my_op.output['dataflow_job_id']
   # Ideal, would be equivalent. to my_op.xcom_pull(key="dataflow_job_id"]
   ```
   
   If we hadn't yet released it, I would have suggested that the facility to 
change the key should have been done by `__getattr__`, yielding:
   
   ```python
   my_op.output.some_xcom_key # my_op.xcom_pull(key='some_xcom_key')
   my_op.output['attr'] # my_op.xcom_pull(key='return_value')['attr']
   ```
   
   But that ship is sailed, so I'm not sure how to proceed nicely.


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