from pandas import DataFrame

from xurpas_data_quality.render.render import render_report
from xurpas_data_quality.data.descriptions import TableDescription
from xurpas_data_quality.render.renderer import BaseRenderer, HTMLBase,HTMLContainer
from xurpas_data_quality.render.render_error import render_error

def get_error_report(data:DataFrame, invalid_data:DataFrame, errors:list,name:str, is_empty:bool, minimal:bool)-> BaseRenderer:
    """
    Generates an error report
    """

    content = [render_error(data, invalid_data, errors, name, is_empty, minimal)]
    content.extend(render_report(data=data, report_name=name, minimal=minimal))
    body = HTMLContainer(
        type="sections",
        container_items = content
    )


    return HTMLBase(body=body, name='Data Report' if name is None else name)
    #return render_error(df, invalid_df, errors,name,is_empty,minimal)