You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "kmsantanu (via GitHub)" <gi...@apache.org> on 2025/04/08 06:10:53 UTC
[D] Dynamic generate dag using JINJA templet are not appearing in the airflow UI [airflow]
GitHub user kmsantanu created a discussion: Dynamic generate dag using JINJA templet are not appearing in the airflow UI
Hello Team
we generate the dag using below JINJA templet and its created a dag1.py ...but it is not appearing in Airflow UI and also not Runnings as per schedule time
when I am using a command inside worker pod
airflow dags reserialize
its appeared in UI and runs and dissapeared.In production some one cannot do this every time.How to fix
from airflow import DAG
from airflow.operators.python import PythonOperator
from datetime import datetime, timedelta
def print_hello():
print("Hello World {{ dag_id }}")
default_args = {
'owner': 'fasadmin',
'depends_on_past': False,
'start_date': datetime(2024, 10, 15),
'email_on_failure': False,
'email_on_retry': False,
'retries': 1,
'retry_delay': timedelta(minutes=5),
}
dag = DAG(
'{{ dag_id }}',
default_args=default_args,
description='A simple DAG to print Hello World dynamically',
schedule_interval="*/2 * * * *", # Set to None for on-demand execution
is_paused_upon_creation=False,
catchup=False,
concurrency=1,
max_active_runs=1,
tags=["dynamic"],
)
t1 = PythonOperator(
task_id='print_hello',
python_callable=print_hello,
dag=dag,
)
t1
globals()["{{ dag_id }}"] = dag
GitHub link: https://github.com/apache/airflow/discussions/48911
----
This is an automatically sent email for commits@airflow.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@airflow.apache.org
Re: [D] Dynamic generate dag using JINJA templet are not appearing in the airflow UI [airflow]
Posted by "kmsantanu (via GitHub)" <gi...@apache.org>.
GitHub user kmsantanu edited a discussion: Dynamic generate dag using JINJA templet are not appearing in the airflow UI
Hello Team
we generate the dag using below JINJA templet and its created a dag1.py ...but it is not appearing in Airflow UI and also not Runnings as per schedule time
when I am using a command inside worker pod
airflow dags reserialize
its appeared in UI and runs and dissapeared.In production some one cannot do this every time.How to fix
Airflow version is 2.10.x
from airflow import DAG
from airflow.operators.python import PythonOperator
from datetime import datetime, timedelta
def print_hello():
print("Hello World {{ dag_id }}")
default_args = {
'owner': 'fasadmin',
'depends_on_past': False,
'start_date': datetime(2024, 10, 15),
'email_on_failure': False,
'email_on_retry': False,
'retries': 1,
'retry_delay': timedelta(minutes=5),
}
dag = DAG(
'{{ dag_id }}',
default_args=default_args,
description='A simple DAG to print Hello World dynamically',
schedule_interval="*/2 * * * *", # Set to None for on-demand execution
is_paused_upon_creation=False,
catchup=False,
concurrency=1,
max_active_runs=1,
tags=["dynamic"],
)
t1 = PythonOperator(
task_id='print_hello',
python_callable=print_hello,
dag=dag,
)
t1
globals()["{{ dag_id }}"] = dag
GitHub link: https://github.com/apache/airflow/discussions/48911
----
This is an automatically sent email for commits@airflow.apache.org.
To unsubscribe, please send an email to: commits-unsubscribe@airflow.apache.org