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

   ### Apache Airflow version
   
   2.10.5
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   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
   
   ### What you think should happen instead?
   
   When the DAG is generated in the DAG folder, the DAG should appear 
immediately 
   
   ### How to reproduce
   
   Create a DAG using ninja template in the default DAG folder. 
   Login to the Airflow UI and the DAG is not displayed until we forcefully run 
"airflow dags reserialize"
   
   ### Operating System
   
   k8s
   
   ### Versions of Apache Airflow Providers
   
   Bitnami
   
   ### Deployment
   
   Official Apache Airflow 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to