def sla_miss_count_df(input_df, timeframe):
    """Group the data based on dagid and taskid and calculate its count and avg duration

    Args:
        input_df (dataframe): sla_run_detail base table
        timeframe (integer): Timeframes entered by the user according to which KPI's will be calculated

    Returns:
        dataframes: Intermediate output dataframes required for further processing of data
    """
    df1 = input_df[input_df["duration"] > input_df["sla"]][input_df["start_date"].between(timeframe, today)]
    df2 = df1.groupby(["dag_id", "task_id"]).size().to_frame(name="size").reset_index()
    df3 = df1.groupby(["dag_id", "task_id"])["duration"].mean().reset_index()
    return df2, df3
Group the data based on dagid and taskid and calculate its count and avg duration

    Args:
        input_df (dataframe): sla_run_detail base table
        timeframe (integer): Timeframes entered by the user according to which KPI's will be calculated

    Returns:
        dataframes: Intermediate output dataframes required for further processing of data
    
sla-miss-report/airflow-sla-miss-report.py