def get_attendance(conditions, filters):
    attendance = frappe.db.sql(('Select name,employee, employee_name, department,attendance_date, shift,status\n    From `tabAttendance` Where status = "Absent" and docstatus = 1 and %s group by employee,attendance_date' % conditions), filters, as_dict=1)
    employee = frappe.db.get_all('Employee', {'status': 'Active'}, ['name'])
    row = []
    emp_count = 0
    import pandas as pd
    mydates = pd.date_range(filters.from_date, filters.to_date).tolist()
    absent_date = []
    for emp in employee:
        for date in mydates:
            for att in attendance:
                if (emp.name == att.employee):
                    if (att.attendance_date == date.date()):
                        att_date = date.date()
                        absent_date += [date.date()]
                        emp_count += 1
    if (emp_count >= 3):
        for ab_date in absent_date:
            row += [(att.name, ab_date, att.employee, att.employee_name, att.department, att.status)]
            frappe.errprint(row)
    return row
def get_attendance(conditions, filters):
    attendance = frappe.db.sql(('Select name,employee, employee_name, department,attendance_date, shift,status\n    From `tabAttendance` Where status = "Absent" and docstatus = 1 and %s group by employee,attendance_date' % conditions), filters, as_dict=1)
    employee = frappe.db.get_all('Employee', {'status': 'Active'}, ['name'])
    row = []
    emp_count = 0
    import pandas as pd
    mydates = pd.date_range(filters.from_date, filters.to_date).tolist()
    absent_date = []
    for emp in employee:
        for date in mydates:
            for att in attendance:
                if (emp.name == att.employee):
                    if (att.attendance_date == date.date()):
                        att_date = date.date()
                        absent_date += [date.date()]
                        emp_count += 1
    if (emp_count >= 3):
        for ab_date in absent_date:
            row += [(att.name, ab_date, att.employee, att.employee_name, att.department, att.status)]
            frappe.errprint(row)
    return row