vatsrahul1001 opened a new issue, #46580:
URL: https://github.com/apache/airflow/issues/46580

   ### Apache Airflow version
   
   3.0.0a1
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   DAGRUN is failing with Dynamic Mapped task in the `upstream_failed` state 
even though upstream task is in success state
   
   **Error in schedule logs**
   
   ```
   [2025-02-08T05:18:20.469+0000] {scheduler_job_runner.py:744} INFO - Received 
executor event with state queued for task instance 
TaskInstanceKey(dag_id='context_ref', task_id='a_list', 
run_id='manual__2025-02-08T05:18:19.465557+00:00', try_number=1, map_index=-1)
   [2025-02-08T05:18:20.479+0000] {scheduler_job_runner.py:776} INFO - Setting 
external_id for <TaskInstance: context_ref.a_list 
manual__2025-02-08T05:18:19.465557+00:00 [queued]> to 
e229edfa-f569-4e19-af4e-32f9a4c5b303
   [2025-02-08T05:18:22.141+0000] {taskmap.py:148} ERROR - Cannot expand 
'\x1b[1m<Mapped(_PythonDecoratedOperator): ref_context>\x1b[22m' for run 
manual__2025-02-08T05:18:19.465557+00:00; missing upstream values: ['num']
   [2025-02-08T05:18:22.165+0000] {scheduler_job_runner.py:744} INFO - Received 
executor event with state success for task instance 
TaskInstanceKey(dag_id='context_ref', task_id='a_list', 
run_id='manual__2025-02-08T05:18:19.465557+00:00', try_number=1, map_index=-1)
   ```
   
   ### What you think should happen instead?
   
   Dynamic mapped task DAG should execute fine as it used to be in AF2
   
   ### How to reproduce
   
   Execute below DAG in with `3.0.0a2`
   
   **DAG**
   ```
   
   from airflow import DAG
   from airflow.decorators import task
   from datetime import datetime
   
   
   @task
   def a_list():
       return [3, 6, 9]
   
   
   @task
   def ref_context(num, **context):
       return num + context["ti"].map_index * 5
   
   
   @task
   def assert_sum(nums, expect):
       print(nums)
       print(f"expecting sum: {' + '.join(map(str,nums))} == {expect}")
       print(sum(nums))
       assert sum(nums) == expect
   
   
   with DAG(
       dag_id="context_ref",
       start_date=datetime(1970, 1, 1),
       schedule=None,
       tags=["taskmap"]
   ) as dag:
       assert_sum(ref_context.expand(num=a_list()), 33)
   ```
   
   ### Operating System
   
   Linux
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other
   
   ### Deployment details
   
   _No response_
   
   ### 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: commits-unsubscr...@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to