title: airflow - clean up database before backfill task
body: <p>I need to clean up databases (postgres/mongo) before backfilling of tasks connected to aiflow DAG. Let's assume this simple DAG:</p>
  <pre><code>     -&gt;task2
  task1       -&gt;task4
       -&gt;task3
  </code></pre>
  <p>Each task writes it's results to database</p>
  <p><strong>On normal execution</strong> on daily basis everything is ok - there is no data in databases regarding processing actual day.</p>
  <p><strong>But when it comes to backfill</strong> of this DAG, when past days were already processed but we need backfill to compute results one more time (i.e. code for task2 was changed and we need refresh) there are already data in databases to corresponding past days and there will be i.e duplicateError raised during backfill. So now I need to delete manually data corresponding to tasks that need backfill before executing backfill.</p>
  <p><strong>I want to</strong>: for each task make script which will do cleaning corresponding data from databases for current execution date and run this script <strong>just before</strong> running real task that will fill data in databases once again. But for performance reasons I want this <strong>deletion script</strong> to run only when there is backfill processed and not run it on daily execution of DAG.</p>
  <p><strong>What I am missing</strong> is how to tell if task is being run by backfill or normal daily execution (some flag etc) or maybe there is option to run something like <code>pre_task_execute_when_backfill_callable</code> function to assign somewhere in airflow task?</p>