ephraimbuddy commented on issue #19071:
URL: https://github.com/apache/airflow/issues/19071#issuecomment-946820350


   You can't get xcom passed to the SSHOperator this way. What you want is only 
possible when both tasks are taskflow API. 
   
   For your case, you have to explicitly push xcom and use template strings to 
pull in SSHOperator. 
   
   ```python
   
       @task
       def build_command(ti=None) -> str:
           xcom = 'whoami'
           ti.xcom_push(value=xcom)
   
       ssh = SSHOperator(
           task_id='run_my_command',
           command="{{ ti.xcom_pull(task_ids=['build_command']) }}",
           ssh_conn_id='default_conn',
           retries=0
       )
       build_command >> ssh
   ```
   
   Closing this as it's not an issue. 


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