potiuk commented on issue #19477:
URL: https://github.com/apache/airflow/issues/19477#issuecomment-963448627


   Copied from discussion:
   here is some code examples:
   
   ```
   from datetime import datetime
   
   from airflow.operators.python_operator import PythonOperator
   from airflow import DAG
   
   with DAG('a_dag',  schedule_interval=None, default_args={'start_date': 
datetime(2018, 1, 1, 0, 0, 0)}) as dag:
       def success(*args, **kwargs):
           print('ok')
   
       some_task = PythonOperator(task_id='some_tasks', python_callable=success)
   ```
   
   and with new task
   
   ```
   from datetime import datetime
   
   from airflow.operators.python_operator import PythonOperator
   from airflow import DAG
   
   with DAG('a_dag',  schedule_interval=None, default_args={'start_date': 
datetime(2018, 1, 1, 0, 0, 0)}) as dag:
       def success(*args, **kwargs):
           print('ok')
   
       some_task = PythonOperator(task_id='some_tasks', python_callable=success)
       new_task = PythonOperator(task_id='new_task', python_callable=success)
   and steps to reproduce:
   ```
   1. Define "a_dag" with "some_tasks".
   2. Create dag run (manually or by schedule)
   3. Add "new_task" into dag, deploy code
   4. Select "new_task" in UI and press "Run" button
   


-- 
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