Skip to content
SupportLogin

Complete a batch upload and trigger processing

datasets.upload.complete_batch(UploadCompleteBatchParams**kwargs) -> UploadCompleteBatchResponse
POST/api/v1/datasets/upload/complete-batch

Any TXT files in the batch are converted to csv/jsonl. Batches that still contain documents (pdf/docx/pptx/xlsx/html, or unpacked zip contents) move to awaiting_preprocessing and wait for an explicit launch-preprocessing call. Batches with only tabular formats (csv/json/jsonl/parquet, plus any converted-from-TXT files) move directly to column extraction.

ParametersExpand Collapse
dataset_id: str

Dataset ID from initiate-batch

files: Iterable[File]
s3_key: str

S3 key returned from initiate-batch

file_name: str

Original file name

file_format: Literal["csv", "json", "jsonl", 8 more]

File format

One of the following:
"csv"
"json"
"jsonl"
"parquet"
"pdf"
"docx"
"pptx"
"xlsx"
"html"
"zip"
"txt"
file_size_bytes: float

File size in bytes

defer_adaption: Optional[bool]

When true, the upload is stored but Adaptive Data does not start. The dataset stays in awaiting_preprocessing until POST /datasets/:id/start-adaption.

ReturnsExpand Collapse
class UploadCompleteBatchResponse:
dataset_id: str

Dataset ID

status: str

Current dataset status

Complete a batch upload and trigger processing

import os
from adaption import Adaption

client = Adaption(
    api_key=os.environ.get("ADAPTION_API_KEY"),  # This is the default and can be omitted
)
response = client.datasets.upload.complete_batch(
    dataset_id="dataset_id",
    files=[{
        "s3_key": "s3_key",
        "file_name": "file_name",
        "file_format": "csv",
        "file_size_bytes": 0,
    }],
)
print(response.dataset_id)
{
  "dataset_id": "dataset_id",
  "status": "status"
}
Returns Examples
{
  "dataset_id": "dataset_id",
  "status": "status"
}