Skip to content

Instantly share code, notes, and snippets.

View camilomartinez's full-sized avatar

Camilo Martinez camilomartinez

  • Amsterdam, Netherlands
View GitHub Profile
@camilomartinez
camilomartinez / callback_retry_clear_subdag.py
Last active May 28, 2021 15:47 — forked from nathairtras/callback_retry_clear_subdag.py
Callback to clear Airflow SubDag on retry
import logging
from airflow.models import DagBag
def callback_subdag_clear(context):
"""Clears a subdag's tasks on retry."""
dag_id = "{}.{}".format(
context['dag'].dag_id,
context['ti'].task_id,
)
execution_date = context['execution_date']