def METHOD_NAME(
        session, scanner_index_id, succeeded, failed):
    """Mark the current 'scanner_index' row as complete.
    Args:
        session (Session): SQLAlchemy session object.
        scanner_index_id (str): id of the `ScannerIndex` row to mark
        succeeded (list): names of scanners that ran successfully
        failed (list): names of scanners that failed
    """
    scanner_index = (
        session.query(scanner_dao.ScannerIndex)
        .filter(scanner_dao.ScannerIndex.id == scanner_index_id).one())
    if failed and succeeded:
        scanner_index.complete(IndexState.PARTIAL_SUCCESS)
    elif not failed:
        scanner_index.complete(IndexState.SUCCESS)
    else:
        scanner_index.complete(IndexState.FAILURE)
    if failed:
        scanner_index.set_error(session, _error_message(failed))
    session.add(scanner_index)
    session.flush()