def export_aggregate_results()

in auto_sizing/cli.py [0:0]


def export_aggregate_results(project_id, bucket, run_date):
    """
    Retrieves all results from an auto_sizing Argo run from a GCS bucket.
    Aggregates those results into one JSON file and reuploads to that bucket.
    """
    if bucket is None:
        raise ValueError("A GCS bucket must be provided to export aggregate results.")

    run_date_str = datetime.today().strftime("%Y-%m-%d")
    if run_date is None:
        logger.info(f"No date specified, using today's date ({run_date_str})")
    else:
        run_date_str = run_date.strftime("%Y-%m-%d")

    aggregate_and_reupload(project_id=project_id, bucket_name=bucket, run_date=run_date_str)