Open ginwakeup opened 1 year ago
Hi,
I am also looking to change task queues dynamically. Did you find any solution?
Hi,
I am also looking to change task queues dynamically. Did you find any solution?
@prernadubey I started implementing a solution for this but it's quite hard. I got something to work by setting a __queue attribute inside dag_run.conf[airflow] that is evaluated to define what queue to use, but I am struggling a bit to make it work with the UI, so the queue is correctly visualized on the WebServer. The solution still has some issues, it's more a hack than anything else for now.
Apache Airflow version
Other Airflow 2 version (please specify below)
What happened
I am using
task_instance_mutation_hook
to change a task instance at run-time but the task_instance.dag_run property is None.I can see this is executed on the WebServer, and the dag_run property is None in all these cases:
What you think should happen instead
The dag_run property should not be None, so I can fetch properties such as
params
from it in the task_mutation_hook.How to reproduce
Install Airflow 2.5.3 using Helm Chart on Kubernetes
Edit the
airflowLocalSettings
section to use the following policy:Run Airflow
Create the following DAG:
Trigger the DAG from WebServer UI or API call.
Observe the logs in the webserver, the
task_instance
dag_run property is None:Operating System
Ubuntu 20.04
Versions of Apache Airflow Providers
No response
Deployment
Official Apache Airflow Helm Chart
Deployment details
Helm chart in Kubernetes
Anything else
Happens every time
Are you willing to submit PR?
Code of Conduct