def process_compliance_data(results, stats_store):
    """Process compliance data and update Stats table.

    Args:
        results (list): Results of sub-orchestrator calls.
        stats_store (ExportsTableStore): Object of Stats table to be updated.
    """
    try:
        compliance_job_finished = results[2]
        compliance_id = compliance_job_finished["id"] if "id" in compliance_job_finished else ""
        chunks = compliance_job_finished["chunks"] if "chunks" in compliance_job_finished else [
        ]
        chunk_ids = ",".join(str(c) for c in chunks)
        if compliance_id != "":
            stats_store.merge(compliance_id, "prime", {
                "status": TenableStatus.finished.value,
                "chunks": chunk_ids,
                "totalChunksCount": len(chunks)
            })
    except IndexError as e:
        logging.warning("compliance job returned no results")
        logging.warning(e)
Process compliance data and update Stats table.

    Args:
        results (list): Results of sub-orchestrator calls.
        stats_store (ExportsTableStore): Object of Stats table to be updated.
    
Solutions/Tenable App/Data Connectors/TenableVM/TenableExportsOrchestrator/__init__.py