airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [airflow] tooptoop4 commented on a change in pull request #6956: [AIRFLOW-6387] print details of success/skipped task
Date Wed, 01 Jan 2020 18:39:39 GMT
tooptoop4 commented on a change in pull request #6956: [AIRFLOW-6387] print details of success/skipped
task
URL: https://github.com/apache/airflow/pull/6956#discussion_r362337203
 
 

 ##########
 File path: airflow/models/taskinstance.py
 ##########
 @@ -963,12 +963,31 @@ def signal_handler(signum, frame):
                 Stats.incr('ti_successes')
             self.refresh_from_db(lock_for_update=True)
             self.state = State.SUCCESS
+            self.log.info(
+                'Marking task as SUCCESS.'
+                'dag_id=%s, task_id=%s, execution_date=%s, start_date=%s, end_date=%s',
+                self.dag_id,
+                self.task_id,
+                self.execution_date.strftime('%Y%m%dT%H%M%S'),
+                self.start_date.strftime('%Y%m%dT%H%M%S'),
+                self.end_date.strftime('%Y%m%dT%H%M%S'))
         except AirflowSkipException as e:
             # log only if exception has any arguments to prevent log flooding
             if e.args:
                 self.log.info(e)
             self.refresh_from_db(lock_for_update=True)
             self.state = State.SKIPPED
+            try:
+                self.log.info(
+                    'Marking task as SKIPPED.'
+                    'dag_id=%s, task_id=%s, execution_date=%s, start_date=%s, end_date=%s',
+                    self.dag_id,
+                    self.task_id,
+                    self.execution_date.strftime('%Y%m%dT%H%M%S'),
+                    self.start_date.strftime('%Y%m%dT%H%M%S'),
+                    self.end_date.strftime('%Y%m%dT%H%M%S'))
+            except NameError:
 
 Review comment:
   wasn't sure where skip exception could be thrown so just a railguard

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message