feluelle 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_r362171481
##########
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:
Is the `try-except` really necessary?
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services