You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/01/28 12:18:37 UTC

[GitHub] [airflow] csp98 opened a new issue #21183: Webserver "External DAG" button on ExternalTaskSensor not working when dag_id is templated

csp98 opened a new issue #21183:
URL: https://github.com/apache/airflow/issues/21183


   ### Apache Airflow version
   
   2.0.2
   
   ### What happened
   
   When an ExternalTaskSensor receives a templated dag_id , the web interface's "External DAG" button does not resolve the template, so the destination URL does not work (although the sensor correctly waits for the dag_id that the template refers to)
   
   
   ![image](https://user-images.githubusercontent.com/28935464/151545548-cf60193d-7803-414a-aab6-aecd2cf411b2.png)
   
   ![image](https://user-images.githubusercontent.com/28935464/151544881-9c989b68-975a-480c-b473-808da0a892be.png)
   
   ![image](https://user-images.githubusercontent.com/28935464/151545663-6982156b-47ef-4b42-a777-02a09811c382.png)
   
   
   ### What you expected to happen
   
   The button's destination URL should point to the templated dag_id.
   
   ### How to reproduce
   
   1. Create a DAG with an ExternalTaskSensor whose dag_id is templated
   ```python
   @provide_session
   def get_last_run_id(execution_date: datetime, session: Any, **context: Any) -> datetime:
       dag_id = context['task_instance'].xcom_pull('get_idemp', key='id_emp')
       while (last_run := get_last_dagrun(dag_id, session, include_externally_triggered=True)) is None:
           continue
       return last_run.execution_date
   
   sensor = ExternalTaskSensor(
       task_id="wait_for_dag",
       external_dag_id="{{ ti.xcom_pull('get_idemp', key='id_emp') }}",
       external_task_id="update_load_registry", <---------- Last DAG operator
       execution_date_fn=get_last_run_id
   )
   ```
   2. Trigger the created DAG
   3. Click on the ExternalTaskSensor operator
   4. Click on the "External DAG" button 
   
   ### Operating System
   
   Debian GNU/Linux 10 (buster) (on KubernetesExecutor)
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Other 3rd-party Helm chart
   
   ### 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-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] potiuk closed issue #21183: Webserver "External DAG" button on ExternalTaskSensor not working when dag_id is templated

Posted by GitBox <gi...@apache.org>.
potiuk closed issue #21183:
URL: https://github.com/apache/airflow/issues/21183


   


-- 
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-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] boring-cyborg[bot] commented on issue #21183: Webserver "External DAG" button on ExternalTaskSensor not working when dag_id is templated

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #21183:
URL: https://github.com/apache/airflow/issues/21183#issuecomment-1024161351


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


-- 
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-unsubscribe@airflow.apache.org

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