(report_data_cache, report_config, data_source, deferred_fields, filter_options_by_field, row_to_element)
return row_elements
:param row_to_element: function (
                deferred_fields, filter_options_by_field, row, index, is_total_row
            ) -> row_element
:param row_to_element: function (
                deferred_fields, filter_options_by_field, row, index, is_total_row
            ) -> row_element
: param row_to_element : function ( deferred_fields filter_options_by_field row index is_total_row ) - > row_element
def get_report_element(report_data_cache, report_config, data_source, deferred_fields, filter_options_by_field, row_to_element):
    """
    :param row_to_element: function (
                deferred_fields, filter_options_by_field, row, index, is_total_row
            ) -> row_element
    """
    if data_source.has_total_row:
        total_row_calculator = IterativeTotalRowCalculator(data_source)
    else:
        total_row_calculator = MockTotalRowCalculator()

    row_elements = []
    row_index = 0
    rows = report_data_cache.get_data(report_config.uuid, data_source)
    for row_index, row in enumerate(rows):
        row_elements.append(row_to_element(deferred_fields, filter_options_by_field, row, row_index))
        total_row_calculator.update_totals(row)

    if data_source.has_total_row:
        total_row = total_row_calculator.get_total_row()
        row_elements.append(row_to_element(
            deferred_fields, filter_options_by_field,
            dict(
                zip(
                    list(data_source.final_column_ids),
                    list(map(str, total_row))
                )
            ),
            row_index + 1,
            is_total_row=True,
        ))
    return row_elements
def get_report_element ( report_data_cache , report_config , data_source , deferred_fields , filter_options_by_field , row_to_element ) : if data_source . has_total_row : total_row_calculator = IterativeTotalRowCalculator ( data_source ) else : total_row_calculator = MockTotalRowCalculator ( ) row_elements = [ ] row_index = 0 rows = report_data_cache . get_data ( report_config . uuid , data_source ) for row_index , row in enumerate ( rows ) : row_elements . append ( row_to_element ( deferred_fields , filter_options_by_field , row , row_index ) ) total_row_calculator . update_totals ( row ) if data_source . has_total_row : total_row = total_row_calculator . get_total_row ( ) row_elements . append ( row_to_element ( deferred_fields , filter_options_by_field , dict ( zip ( list ( data_source . final_column_ids ) , list ( map ( str , total_row ) ) ) ) , row_index + 1 , is_total_row = True , ) ) return row_elements