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 2021/08/03 14:43:23 UTC

[GitHub] [airflow] yevsh opened a new issue #17395: DAG is executed twice on submit

yevsh opened a new issue #17395:
URL: https://github.com/apache/airflow/issues/17395


   Airflow 2.1.2
   runs as pod in kubernetes cluster.
   
   python DAG is placed in airflow_dags location, airflow executes it twice!
   
   From log:
   
   ```
   [2021-08-02 14:48:07,900] {scheduler_job.py:1210} INFO - Executor reports execution of TEST.submit execution_date=2021-08-02 13:48:05.155505+00:00 exited with status success for try_number 1
   [2021-08-02 14:48:07,900] {scheduler_job.py:1210} INFO - Executor reports execution of TEST.submit execution_date=2021-08-02 12:48:05.155505+00:00 exited with status success for try_number 1
   ```
   
   (14:48:07 - is the system time in container) 
   
   ```
   default_args = {   
       'retries': 0,
       'retry_delay': timedelta(0, 300),
       'is_paused_upon_creation': False
   }
   
   
   dag = DAG(
       'TEST',
       default_args=default_args,  
       schedule_interval=relativedelta(hours=+1),
       start_date= datetime(2021,8,2,0,0,1),
       catchup=False,
       is_paused_upon_creation=False,
   )
   ```
   
   


-- 
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] ephraimbuddy commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-975725915


   > I Installed 2.2.1
   > 
   > in dag I have: schedule_interval=relativedelta(day=1,hour=12,months=+1),
   > 
   > from scheduler I ran:
   > 
   > airflow db init
   > 
   > ```
   > 
   > ERROR [airflow.models.dagbag.DagBag] 'relativedelta' object has no attribute 'total_seconds'
   > Traceback (most recent call last):
   >   File "/home/airflow/.local/lib/python3.7/site-packages/airflow/models/dagbag.py", line 515, in collect_dags
   >     found_dags = self.process_file(filepath, only_if_updated=only_if_updated, safe_mode=safe_mode)
   >   File "/home/airflow/.local/lib/python3.7/site-packages/airflow/models/dagbag.py", line 298, in process_file
   >     found_dags = self._process_modules(filepath, mods, file_last_changed_on_disk)
   >   File "/home/airflow/.local/lib/python3.7/site-packages/airflow/models/dagbag.py", line 401, in _process_modules
   >     dag.timetable.validate()
   >   File "/home/airflow/.local/lib/python3.7/site-packages/airflow/timetables/interval.py", line 274, in validate
   >     if self._delta.total_seconds() <= 0:
   > A**ttributeError: 'relativedelta' object has no attribute 'total_seconds'**
   > ```
   
   It's fixed in 2.2.2. See https://github.com/apache/airflow/pull/19418


-- 
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] yevsh edited a comment on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
yevsh edited a comment on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-893306998


   i suspect something related to time/system time?
   bottom 2 runs:
   
   ![image](https://user-images.githubusercontent.com/24428652/128325675-d2d4bf84-9c88-4e73-81fa-c0ed9bc26653.png)
   
   ![image](https://user-images.githubusercontent.com/24428652/128325988-5e244c1d-0318-4525-ac3b-c11f8963932e.png)
   


-- 
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] yevsh commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
yevsh commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-894745228


   @ephraimbuddy is that related to the issue I am having?


-- 
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] yevsh commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
yevsh commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-975789771


   thanks! will reinstall and retest and update


-- 
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] yevsh commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
yevsh commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-893270823


   Can we some how identify the issue?
   What you want me to send?
   
   ![image](https://user-images.githubusercontent.com/24428652/128318078-16760103-861b-4df6-ae62-eb973c20e68e.png)
   
   You can see on the image, the first 2  top screens are teh first and second run, start time is the same.
   the third screen is the third run, with correct start timr as scheduled (all the following runs are correct).
   


-- 
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] yevsh commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
yevsh commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-897362563


   @ephraimbuddy , any ideas? thanks


-- 
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] yevsh commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
yevsh commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-897611069


   @ephraimbuddy thank you! 
   waiting with anticipation


-- 
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] yevsh commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
yevsh commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-893306998


   i suspect something related to time/system time?
   
   ![image](https://user-images.githubusercontent.com/24428652/128325675-d2d4bf84-9c88-4e73-81fa-c0ed9bc26653.png)
   
   ![image](https://user-images.githubusercontent.com/24428652/128325988-5e244c1d-0318-4525-ac3b-c11f8963932e.png)
   


-- 
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] yevsh edited a comment on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
yevsh edited a comment on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-975720585


   I Installed 2.2.1
   
   in dag I have:
   schedule_interval=relativedelta(day=1,hour=12,months=+1),
   
   
   from scheduler  I ran:
   
   
   airflow db init
   
   ```
   
   ERROR [airflow.models.dagbag.DagBag] 'relativedelta' object has no attribute 'total_seconds'
   Traceback (most recent call last):
     File "/home/airflow/.local/lib/python3.7/site-packages/airflow/models/dagbag.py", line 515, in collect_dags
       found_dags = self.process_file(filepath, only_if_updated=only_if_updated, safe_mode=safe_mode)
     File "/home/airflow/.local/lib/python3.7/site-packages/airflow/models/dagbag.py", line 298, in process_file
       found_dags = self._process_modules(filepath, mods, file_last_changed_on_disk)
     File "/home/airflow/.local/lib/python3.7/site-packages/airflow/models/dagbag.py", line 401, in _process_modules
       dag.timetable.validate()
     File "/home/airflow/.local/lib/python3.7/site-packages/airflow/timetables/interval.py", line 274, in validate
       if self._delta.total_seconds() <= 0:
   A**ttributeError: 'relativedelta' object has no attribute 'total_seconds'**
   ```


-- 
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] yevsh commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
yevsh commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-975720585


   I Installed 2.2.1
   
   in dag I have:
   relativedelta(day=1,hour=12,months=+1)
   
   
   from scheduler  I ran:
   
   
   airflow db init
   
   ```
   
   ERROR [airflow.models.dagbag.DagBag] 'relativedelta' object has no attribute 'total_seconds'
   Traceback (most recent call last):
     File "/home/airflow/.local/lib/python3.7/site-packages/airflow/models/dagbag.py", line 515, in collect_dags
       found_dags = self.process_file(filepath, only_if_updated=only_if_updated, safe_mode=safe_mode)
     File "/home/airflow/.local/lib/python3.7/site-packages/airflow/models/dagbag.py", line 298, in process_file
       found_dags = self._process_modules(filepath, mods, file_last_changed_on_disk)
     File "/home/airflow/.local/lib/python3.7/site-packages/airflow/models/dagbag.py", line 401, in _process_modules
       dag.timetable.validate()
     File "/home/airflow/.local/lib/python3.7/site-packages/airflow/timetables/interval.py", line 274, in validate
       if self._delta.total_seconds() <= 0:
   A**ttributeError: 'relativedelta' object has no attribute 'total_seconds'**
   ```


-- 
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] github-actions[bot] commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-999951256


   This issue has been automatically marked as stale because it has been open for 30 days with no response from the author. It will be closed in next 7 days if no further activity occurs from the issue author.


-- 
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] github-actions[bot] commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-1002819796


   This issue has been closed because it has not received response from the issue author.


-- 
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] yevsh commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
yevsh commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-893270823






-- 
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] ephraimbuddy commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-893233185


   @yevsh , I was not able to reproduce this. I ran the dag with a BashOperator and it ran only once. 
   ```
   Running <TaskInstance: TEST.mytask 2021-08-05T06:28:49.486720+00:00 [queued]> on host bbc97c9f13a8
   [2021-08-05 07:28:56,117] {dagrun.py:435} INFO - Marking run <DagRun TEST @ 2021-08-05 06:28:49.486720+00:00: scheduled__2021-08-05T06:28:49.486720+00:00, externally triggered: False> successful
   [2021-08-05 07:28:56,127] {scheduler_job.py:577} INFO - Executor reports execution of TEST.mytask execution_date=2021-08-05 06:28:49.486720+00:00 exited with status success for try_number 1
   ```
   Can you provide more information?


-- 
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] yevsh commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
yevsh commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-893348259


   very simple python that I just created.
   And placed it in dags folder.
   
   ```
   
   from airflow import DAG
   from datetime import timedelta
   from airflow.utils.dates import days_ago
   from dateutil.relativedelta import *
   from datetime import datetime
   from airflow.models import BaseOperator
   from airflow.utils.decorators import apply_defaults
   
   
   class Test(BaseOperator):
       @apply_defaults
       def __init__(
           self,
           *args, **kwargs):
   
           super(Test, self).__init__(*args, **kwargs)
   
   
       def execute(self, context):
           self.log.info("Running")
   
   
   default_args = {
       'owner': 'airflow',
       'depends_on_past': False,
       'max_active_runs': 1,
       'retries': 0,
       'retry_delay': timedelta(0, 3000),
       'is_paused_upon_creation': False
   
   }
   
   
   dag = DAG(
       'TEST900',
       default_args=default_args,
       schedule_interval=relativedelta(hours=+1),
       start_date= datetime(2021,1,3),
       catchup=False,
       is_paused_upon_creation=False,
   )
   
   t1 = Test(
       task_id='Prd',
   )
   
   
   t1
   ```


-- 
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] ephraimbuddy commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-897429200


   @yevsh, Airflow support for the kind of combinations you want is incoming with [AIP-39](https://cwiki.apache.org/confluence/display/AIRFLOW/AIP-39+Richer+scheduler_interval). For now, you should use simple combinations.
   AIP-39 is in progress and will be out in no distant time.


-- 
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 commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-917590407


   We just released Beta version of 2.2: https://lists.apache.org/thread.html/r84ac8e69bd25d6a3153bf537975f41be6cc987502ae80679dc36bf17%40%3Cdev.airflow.apache.org%3E
   
   Basically the sooner people start testing it, and report issues and we fix them - the sooner we releaseit. So the best way you can do to speed up the release is take the beta for the spin and start testing it today :)


-- 
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] yevsh commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
yevsh commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-917588034


   Is there ETA for the release?


-- 
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 edited a comment on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
potiuk edited a comment on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-917590407


   We just released Beta version of 2.2: https://lists.apache.org/thread.html/r84ac8e69bd25d6a3153bf537975f41be6cc987502ae80679dc36bf17%40%3Cdev.airflow.apache.org%3E
   
   Basically the sooner people start testing it, and report issues and we fix them - the sooner we release it. So the best way you can do to speed up the release is take the beta for the spin and start testing it today :)


-- 
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] ephraimbuddy commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-893233185






-- 
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] ephraimbuddy commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-894774973


   > @ephraimbuddy is that related to the issue I am having?
   
   Not related. 
   The problem is on the schedule_interval. I ran your dag and reproduced the behavior. I changed the schedule_interval to `schedule_interval=timedelta(hours=1)` and it stopped happening.
   I do not fully understand the concept of `relativedelta`, I would have tried an alternative and suggest


-- 
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] github-actions[bot] closed issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed issue #17395:
URL: https://github.com/apache/airflow/issues/17395


   


-- 
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] ephraimbuddy commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-893297114


   You can provide the complete dag @yevsh, just enough information to reproduce the behavior on my end.
   
   From the image, I can see that the first two have different Run IDs, but were started at the same time. 


-- 
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] yevsh edited a comment on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
yevsh edited a comment on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-893270823






-- 
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] yevsh edited a comment on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
yevsh edited a comment on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-893270823


   @ephraimbuddy 
   
   thanks for replying 
   
   Can we some how identify the issue?
   What you want me to send?
   
   ![image](https://user-images.githubusercontent.com/24428652/128318078-16760103-861b-4df6-ae62-eb973c20e68e.png)
   
   You can see on the image, the first 2  top screens are teh first and second run, start time is the same.
   the third screen is the third run, with correct start timr as scheduled (all the following runs are correct).
   


-- 
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] yevsh commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
yevsh commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-894775353


   relativedelta is much more powerful that allows different combinations.
   
   I need to use it.
   
   Can we identify why it causes issue?
   


-- 
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] ephraimbuddy commented on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
ephraimbuddy commented on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-893494138


   You no longer need apply_default when defining custom operators. Can you take a look at this https://airflow.apache.org/docs/apache-airflow/stable/howto/custom-operator.html


-- 
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] yevsh edited a comment on issue #17395: DAG is executed twice on submit

Posted by GitBox <gi...@apache.org>.
yevsh edited a comment on issue #17395:
URL: https://github.com/apache/airflow/issues/17395#issuecomment-893348259


   very simple python that I just created.
   And placed it in dags folder.
   
   ```
   
   from airflow import DAG
   from datetime import timedelta
   from airflow.utils.dates import days_ago
   from dateutil.relativedelta import *
   from datetime import datetime
   from airflow.models import BaseOperator
   from airflow.utils.decorators import apply_defaults
   
   
   class Test(BaseOperator):
       @apply_defaults
       def __init__(
           self,
           *args, **kwargs):
   
           super(Test, self).__init__(*args, **kwargs)
   
   
       def execute(self, context):
           self.log.info("Running")
   
   
   default_args = {
       'owner': 'airflow',
       'depends_on_past': False,
       'max_active_runs': 1,
       'retries': 0,
       'retry_delay': timedelta(0, 3000),
       'is_paused_upon_creation': False
   
   }
   
   
   dag = DAG(
       'TEST900',
       default_args=default_args,
       schedule_interval=relativedelta(hours=+1),
       start_date= datetime(2021,1,3),
       catchup=False,
       is_paused_upon_creation=False,
   )
   
   t1 = Test(
       task_id='Prd',
   )
   
   
   t1
   ```
   
   
   ![image](https://user-images.githubusercontent.com/24428652/128335670-862c2e9a-178a-44c4-8fd6-b08bcb2973b6.png)
   


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