vinny-santaiti opened a new issue, #25008:
URL: https://github.com/apache/airflow/issues/25008

   ### Apache Airflow version
   
   2.3.3 (latest released)
   
   ### What happened
   
   The `airflow tasks test` CLI doesn't seem to work for xcoms, it used to work 
in version 2.2.5. It works fine in the UI.
   Example: airflow tasks test tutorial print_date 2015-06-01
   ```kwargs['ti'].xcom_pull(task_ids='push_data')```
   https://airflow.apache.org/docs/apache-airflow/stable/tutorial.html#id2
   When you push data in a task, then pull xcom data by task_ids in a 
downstream task, it doesnt work.
   
   ### What you think should happen instead
   
   The same cli cmd did work fine in airflow 2.2.5
   
   ### How to reproduce
   
   ```python
   import pendulum
   
   from airflow import DAG
   from airflow.operators.python import PythonOperator
   
   
   with DAG(
       'example_xcom',
       schedule_interval=None,
       start_date=pendulum.datetime(2021, 1, 1, tz="UTC"),
       catchup=False,
   ) as dag:
   
       def push_data(**kwargs):
           return 'data'
   
       def pull_data(**kwargs):
           return kwargs['ti'].xcom_pull(task_ids='push_data')
   
       push_task = PythonOperator(
           task_id='push_data',
           python_callable=push_data
       )
       pull_task = PythonOperator(
           task_id='pull_data',
           python_callable=pull_data
       )
       push_task >> pull_task
   ```
   ```
   airflow tasks test example_xcom push_data 2022-06-01
   [2022-07-12 20:22:53,288] {python.py:173} INFO - Done. Returned value was: 
data
   airflow tasks test example_xcom pull_data 2022-06-01
   [2022-07-12 20:23:05,402] {python.py:173} INFO - Done. Returned value was: 
None
   ```
   
   ### Operating System
   
   docker
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow==2.3.3
   apache-airflow-providers-amazon==4.0.0
   apache-airflow-providers-celery==3.0.0
   apache-airflow-providers-cncf-kubernetes==4.1.0
   apache-airflow-providers-docker==3.0.0
   apache-airflow-providers-elasticsearch==4.0.0
   apache-airflow-providers-ftp==3.0.0
   apache-airflow-providers-google==8.1.0
   apache-airflow-providers-grpc==3.0.0
   apache-airflow-providers-hashicorp==3.0.0
   apache-airflow-providers-http==3.0.0
   apache-airflow-providers-imap==3.0.0
   apache-airflow-providers-microsoft-azure==4.0.0
   apache-airflow-providers-mysql==3.0.0
   apache-airflow-providers-odbc==3.0.0
   apache-airflow-providers-postgres==5.0.0
   apache-airflow-providers-redis==3.0.0
   apache-airflow-providers-sendgrid==3.0.0
   apache-airflow-providers-sftp==3.0.0
   apache-airflow-providers-slack==5.0.0
   apache-airflow-providers-sqlite==3.0.0
   apache-airflow-providers-ssh==3.0.0
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   apache/airflow:2.3.3-python3.8
   https://airflow.apache.org/docs/apache-airflow/stable/start/docker.html
   
   ### Anything else
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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