FelipeRamos-neuro opened a new issue, #42912:
URL: https://github.com/apache/airflow/issues/42912

   ### Apache Airflow version
   
   2.10.2
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   When creating a dag with, for example, `TriggerDagRunOperator` or 
`EmrTerminateJobFlowOperator` and performing an expand on it, the dag is parsed 
and it appears on the UI but when I try to look at the grid or graph view, the 
following error appears:
   
   
![image](https://github.com/user-attachments/assets/9d37781c-d708-4627-87ac-d0fdb9d672b0)
   
    There are two workarounds to this, inserting the operator in a task_group 
and performing expand on the task_group or setting `operator_extra_links = []`
   
   ### What you think should happen instead?
   
   I noticed that this error only appears when attempting to perform dynamic 
task mapping with operators that make use of operator_extra_links. But in 
certain conditions, using the workarounds mentioned above, it still works. And 
according to the documentation it should work in all of them.
   
   ### How to reproduce
   
   ```
   from pendulum import datetime
   from airflow.models.dag import DAG
   from airflow.decorators import task
   from airflow.operators.python import PythonOperator
   from airflow.operators.trigger_dagrun import TriggerDagRunOperator
   
   with DAG(
       dag_id="test_dynamic_trigger_error",
       start_date=datetime(2024, 10, 4),
       catchup=False,
       default_args={"owner": "TESTING"},
       tags=["TESTING","MANUAL"],
       schedule_interval=None,
   ) as dag:
   
       @task
       def init_params(**context):
           config = context["dag_run"].conf
           number_of_executions = config.get("number_of_executions", 5)
           return number_of_executions
   
       def producer(**context):
           number_of_executions = context["ti"].xcom_pull("init_params", 
key="return_value")
           result = []
           for x in range(1, number_of_executions+1):
               result.append({
                       "vars": {
                           "part": str(x)
                       }
                   })
           return result
   
       producer_task = PythonOperator(
           task_id="producer",
           python_callable=producer,
       )
   
       consumer_task = TriggerDagRunOperator.partial(
           task_id="trigger",
           trigger_dag_id="example_simple_dummy",
       ).expand(conf=producer_task.output)
   
       init_params() >> producer_task >> consumer_task
   ```
   
   ### Operating System
   
   Amazon Linux 2
   
   ### Versions of Apache Airflow Providers
   
   ```
   apache-airflow-providers-amazon==8.28.0
   apache-airflow-providers-apprise==1.4.0
   apache-airflow-providers-atlassian-jira==2.7.0
   apache-airflow-providers-celery==3.8.1
   apache-airflow-providers-cncf-kubernetes==8.4.1
   apache-airflow-providers-common-compat==1.2.0
   apache-airflow-providers-common-io==1.4.0
   apache-airflow-providers-common-sql==1.16.0
   apache-airflow-providers-docker==3.13.0
   apache-airflow-providers-elasticsearch==5.5.0
   apache-airflow-providers-fab==1.3.0
   apache-airflow-providers-ftp==3.11.0
   apache-airflow-providers-github==2.7.0
   apache-airflow-providers-google==10.22.0
   apache-airflow-providers-grpc==3.6.0
   apache-airflow-providers-hashicorp==3.8.0
   apache-airflow-providers-http==4.13.0
   apache-airflow-providers-imap==3.7.0
   apache-airflow-providers-microsoft-azure==10.4.0
   apache-airflow-providers-mysql==5.7.0
   apache-airflow-providers-odbc==4.7.0
   apache-airflow-providers-openai==1.3.0
   apache-airflow-providers-openlineage==1.11.0
   apache-airflow-providers-postgres==5.12.0
   apache-airflow-providers-redis==3.8.0
   apache-airflow-providers-sendgrid==3.6.0
   apache-airflow-providers-sftp==4.11.0
   apache-airflow-providers-slack==8.9.0
   apache-airflow-providers-smtp==1.8.0
   apache-airflow-providers-snowflake==5.7.0
   apache-airflow-providers-sqlite==3.9.0
   apache-airflow-providers-ssh==3.13.1
   ```
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   Deployment on EKS using the official Helm Chart with ArgoCD
   
   ### 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