aip_sdk.create_partition
aip_sdk.create_partition(dataset_id: str, version_id: str, *, name: str, selector: PartitionSelector, client: APIClient | None = None) -> Partition
Create a partition on a dataset version.
Parameters
dataset_idstr: Dataset ID.version_idstr: Dataset version ID to attach the partition to.namestr: Partition name, unique within the version. Surrounding whitespace is trimmed.selectorPartitionSelector: The selector naming the evaluation target.partition_typeon the created partition is derived from the selector. ASESSIONorTRACEselector carries notarget/ancestry_path; aSPANselector may use them to narrow which spans match, or omit them to select every span.clientAPIClient | None: Optional API client.
Returns
Partition: The created partition.
Raises
InvalidArgumentError: Ifnameis blank or longer than 255 characters, orselectoris inconsistent with its partition type.DuplicatePartitionError: If a partition with this name already exists on the version.AuthError: If credentials are missing or invalid.ForbiddenError: If the caller lacks editor rights on the version's workspace.NotFoundError: If the dataset version does not exist, or belongs to a workspace the caller is not a member of.UnprocessableEntityError: If the version is not an agent-trace version.ResponseParseError: If the platform's response does not match this SDK version.