Skip to main content

aip_sdk.datasets

Dataset CRUD operations.

aip_sdk.datasets.CommitBatchRequest​

aip_sdk.datasets.CommitBatchRequest

Request model for atomic batch row operations.

aip_sdk.datasets.CommitBatchRequest.adds​

aip_sdk.datasets.CommitBatchRequest.adds: list[dict[str, Any]] | None = None

No docstring is defined in the source.

aip_sdk.datasets.CommitBatchRequest.current_snapshot_id​

aip_sdk.datasets.CommitBatchRequest.current_snapshot_id: _SnapshotId = None

No docstring is defined in the source.

aip_sdk.datasets.CommitBatchRequest.deletes​

aip_sdk.datasets.CommitBatchRequest.deletes: list[str] | None = None

No docstring is defined in the source.

aip_sdk.datasets.CommitBatchRequest.updates​

aip_sdk.datasets.CommitBatchRequest.updates: dict[str, dict[str, Any]] | None = None

No docstring is defined in the source.

aip_sdk.datasets.DeleteRowsRequest​

aip_sdk.datasets.DeleteRowsRequest

Request model for deleting rows.

aip_sdk.datasets.DeleteRowsRequest.current_snapshot_id​

aip_sdk.datasets.DeleteRowsRequest.current_snapshot_id: _SnapshotId = None

No docstring is defined in the source.

aip_sdk.datasets.DeleteRowsRequest.row_ids​

aip_sdk.datasets.DeleteRowsRequest.row_ids: list[str] = Field(..., min_length=1)

No docstring is defined in the source.

aip_sdk.datasets.InsertRowsRequest​

aip_sdk.datasets.InsertRowsRequest

Request model for inserting rows.

aip_sdk.datasets.InsertRowsRequest.current_snapshot_id​

aip_sdk.datasets.InsertRowsRequest.current_snapshot_id: _SnapshotId = None

No docstring is defined in the source.

aip_sdk.datasets.InsertRowsRequest.rows​

aip_sdk.datasets.InsertRowsRequest.rows: list[dict[str, Any]] = Field(..., min_length=1)

No docstring is defined in the source.

aip_sdk.datasets.RowOperationResponse​

aip_sdk.datasets.RowOperationResponse

Response model for row operations.

aip_sdk.datasets.RowOperationResponse.adds​

aip_sdk.datasets.RowOperationResponse.adds: list[dict[str, Any]]

No docstring is defined in the source.

aip_sdk.datasets.RowOperationResponse.deletes​

aip_sdk.datasets.RowOperationResponse.deletes: list[str]

No docstring is defined in the source.

aip_sdk.datasets.RowOperationResponse.updates​

aip_sdk.datasets.RowOperationResponse.updates: dict[str, dict[str, Any]]

No docstring is defined in the source.

aip_sdk.datasets.UpdateRowsRequest​

aip_sdk.datasets.UpdateRowsRequest

Request model for updating rows.

aip_sdk.datasets.UpdateRowsRequest.current_snapshot_id​

aip_sdk.datasets.UpdateRowsRequest.current_snapshot_id: _SnapshotId = None

No docstring is defined in the source.

aip_sdk.datasets.UpdateRowsRequest.updates​

aip_sdk.datasets.UpdateRowsRequest.updates: dict[str, dict[str, Any]] = Field(..., min_length=1)

No docstring is defined in the source.

aip_sdk.datasets.aload_dataset​

async aip_sdk.datasets.aload_dataset(reference: str | None = None, *, id: str | None = None, client: APIClient | None = None, workspace_id: str | None = None, all_workspaces: bool = False) -> Dataset

Async variant of load_dataset().

Reads your session's workspace unless you name one, and raises if none is set. Pass all_workspaces=True to read across every workspace you can access.

Parameters

  • reference str | None: Dataset name. The "name@vN" syntax is not supported (version pinning not yet implemented). UUID lookup requires id=.
  • id str | None: Dataset UUID for direct ID lookup (keyword-only).
  • client APIClient | None: Optional API client.
  • workspace_id str | None: Search only this workspace.
  • all_workspaces bool: Search every workspace you can access.

Returns

Raises

Examples:

ds = await aip.aload_dataset("compliance-test-set")
ds = await aip.aload_dataset(id="uuid-...")

aip_sdk.datasets.commit_row_batch​

aip_sdk.datasets.commit_row_batch(dataset_id: str, adds: list[dict[str, Any]] | None = None, updates: dict[str, dict[str, Any]] | None = None, deletes: list[str] | None = None, current_snapshot_id: str | int | None = None, client: APIClient | None = None) -> RowOperationResponse

Commit an atomic mix of insert / update / delete operations.

All operations are applied in a single Iceberg snapshot.

Parameters

  • dataset_id str: Dataset ID.
  • adds list[dict[str, Any]] | None: Rows to insert.
  • updates dict[str, dict[str, Any]] | None: Mapping of {row_id: {column: new_value}}.
  • deletes list[str] | None: Row IDs to delete.
  • current_snapshot_id str | int | None: Optional Iceberg snapshot ID for conflict detection. Accepts either str or int; serialised as string to the API.
  • client APIClient | None: Optional API client.

Returns

Raises

  • APIError: On HTTP error, including 409 when current_snapshot_id mismatches.

aip_sdk.datasets.delete_dataset​

aip_sdk.datasets.delete_dataset(dataset_id: str, *, client: APIClient | None = None) -> None

Permanently delete a dataset, all of its versions, and their stored files.

Irreversible and unprompted. To retire a dataset while keeping it readable, use patch_dataset_status(dataset_id, "deprecated") instead.

Returning successfully means the dataset and its versions are gone. Purging the stored files is best-effort and completes after the deletion itself, so an object store outage can leave files behind for the platform to clean up.

Requires the workspace_admin or workspace_editor role.

Parameters

  • dataset_id str: Dataset to delete.
  • client APIClient | None: Optional API client.

Returns

  • None: None.

Raises

  • DatasetNotFoundError: If the dataset does not exist, or was already deleted.
  • DatasetInUseError: If evaluation runs reference one of its versions, or another dataset was derived from it.
  • ForbiddenError: If the caller lacks the workspace_admin or workspace_editor role.
  • AuthError: If credentials are missing or invalid.

Examples:

try:
aip.delete_dataset("ds-abc123")
except aip.DatasetInUseError as err:
print(f"Still referenced by runs: {err.blocking_runs}")

aip_sdk.datasets.delete_rows​

aip_sdk.datasets.delete_rows(dataset_id: str, row_ids: list[str], current_snapshot_id: str | int | None = None, client: APIClient | None = None) -> list[str]

Delete rows by row ID.

Parameters

  • dataset_id str: Dataset ID.
  • row_ids list[str]: List of row IDs to delete.
  • current_snapshot_id str | int | None: Optional Iceberg snapshot ID for conflict detection. Accepts either str or int; serialised as string to the API.
  • client APIClient | None: Optional API client.

Returns

  • list[str]: List of deleted row IDs.

Raises

  • APIError: On HTTP error, including 409 when current_snapshot_id mismatches.

aip_sdk.datasets.get_current_snapshot_id​

aip_sdk.datasets.get_current_snapshot_id(dataset_id: str, client: APIClient | None = None) -> str | None

Return the current Iceberg snapshot ID for a dataset.

Fetches GET /datasets/{id}/snapshots and returns the most-recent snapshot ID, or None if the dataset has no snapshots yet.

Use this to seed current_snapshot_id on mutation calls for optimistic conflict detection. The direct endpoint does not populate current_snapshot_id after row mutations, so this helper exists to fetch it via the snapshots endpoint.

Parameters

  • dataset_id str: Dataset ID.
  • client APIClient | None: Optional API client.

Returns

  • str | None: Most-recent snapshot ID as a string, or None.

aip_sdk.datasets.get_dataset​

aip_sdk.datasets.get_dataset(dataset_id: str, client: APIClient | None = None) -> dict[str, Any]

Get dataset by ID.

Parameters

  • dataset_id str: Dataset ID.
  • client APIClient | None: Optional API client.

Returns

  • dict[str, Any]: Dataset record.

Raises

aip_sdk.datasets.insert_rows​

aip_sdk.datasets.insert_rows(dataset_id: str, rows: list[dict[str, Any]], current_snapshot_id: str | int | None = None, client: APIClient | None = None) -> list[dict[str, Any]]

Insert new rows into a dataset.

Parameters

  • dataset_id str: Dataset ID.
  • rows list[dict[str, Any]]: List of row dicts (excluding _row_id, which is auto-generated).
  • current_snapshot_id str | int | None: Optional Iceberg snapshot ID for conflict detection. Accepts either str or int; serialised as string to the API.
  • client APIClient | None: Optional API client.

Returns

  • list[dict[str, Any]]: Inserted rows, each including the auto-generated _row_id.

Raises

  • APIError: On HTTP error, including 409 when current_snapshot_id mismatches.

aip_sdk.datasets.list_datasets​

aip_sdk.datasets.list_datasets(include_deprecated: bool = False, workspace_id: str | None = None, page: int = 1, per_page: int = 20, client: APIClient | None = None, *, all_workspaces: bool = False) -> list[Dataset]

List datasets, returning typed Dataset objects.

Reads your session's workspace unless you name one, and raises if none is set. Pass all_workspaces=True to read across every workspace you can access.

Parameters

  • include_deprecated bool: Include deprecated datasets.
  • workspace_id str | None: Return only datasets in this workspace.
  • page int: Page number (1-based).
  • per_page int: Items per page (max 100).
  • client APIClient | None: Optional API client.
  • all_workspaces bool: Read across every workspace you can access.

Returns

  • list[Dataset]: List of Dataset objects.

Raises

aip_sdk.datasets.list_versions​

aip_sdk.datasets.list_versions(dataset_id: str, page: int = 1, per_page: int = 20, client: APIClient | None = None) -> list[DatasetVersion]

List versions for a dataset.

Parameters

  • dataset_id str: Dataset ID
  • page int: Page number (1-based)
  • per_page int: Items per page (max 100)
  • client APIClient | None: Optional API client

Returns

  • list[DatasetVersion]: List of DatasetVersion instances

aip_sdk.datasets.load_dataset​

aip_sdk.datasets.load_dataset(reference: str | None = None, *, id: str | None = None, client: APIClient | None = None, workspace_id: str | None = None, all_workspaces: bool = False) -> Dataset

Load a dataset by name or by UUID via id=.

A name search reads your session's workspace unless you name one, and raises if none is set; pass all_workspaces=True to search every workspace you can access, where a name used twice resolves arbitrarily. Lookup by id is unaffected.

Parameters

  • reference str | None: Dataset name. Always treated as a name search — UUID lookup requires id=. The "name@vN" syntax is not supported: version pinning is not yet implemented (use ds.versions() to inspect available versions).
  • id str | None: Dataset UUID for direct GET /datasets/{id} lookup (keyword-only).
  • client APIClient | None: Optional API client.
  • workspace_id str | None: Search only this workspace.
  • all_workspaces bool: Search every workspace you can access.

Returns

Raises

Examples:

ds = aip.load_dataset("compliance-test-set") # by name
ds = aip.load_dataset(id="uuid-...") # by UUID
df = ds.download()

aip_sdk.datasets.patch_dataset_status​

aip_sdk.datasets.patch_dataset_status(dataset_id: str, status: str, client: APIClient | None = None) -> dict[str, Any]

Transition dataset status (admin only).

Valid transitions:

  • pending → active
  • pending → failed
  • failed → pending
  • active → deprecated

Parameters

  • dataset_id str: Dataset ID
  • status str: Target status
  • client APIClient | None: Optional API client

Returns

  • dict[str, Any]: Updated dataset record

Raises

aip_sdk.datasets.update_rows​

aip_sdk.datasets.update_rows(dataset_id: str, updates: dict[str, dict[str, Any]], current_snapshot_id: str | int | None = None, client: APIClient | None = None) -> dict[str, dict[str, Any]]

Update existing rows by row ID.

Parameters

  • dataset_id str: Dataset ID.
  • updates dict[str, dict[str, Any]]: Mapping of {row_id: {column: new_value, ...}}.
  • current_snapshot_id str | int | None: Optional Iceberg snapshot ID for conflict detection. Accepts either str or int; serialised as string to the API.
  • client APIClient | None: Optional API client.

Returns

  • dict[str, dict[str, Any]]: Updated rows keyed by row ID.

Raises

  • APIError: On HTTP error, including 409 when current_snapshot_id mismatches.