batch Module

Batch operation namespaces for the Dataverse SDK.

Classes

BatchDataFrameOperations

DataFrame-oriented wrappers for batch record operations.

Provides create, update, and delete that accept pandas.DataFrame / pandas.Series inputs and convert them to standard dicts before enqueueing on the batch. This lets data-science callers feed DataFrames directly into a batch without manual conversion.

Accessed via batch.dataframe.

Example:


   import pandas as pd

   batch = client.batch.new()
   df = pd.DataFrame([
       {"name": "Contoso", "telephone1": "555-0100"},
       {"name": "Fabrikam", "telephone1": "555-0200"},
   ])
   batch.dataframe.create("account", df)
   result = batch.execute()
BatchOperations

Namespace for batch operations (client.batch).

Accessed via client.batch. Use new to create a BatchRequest builder.

Example:


   batch = client.batch.new()
   batch.records.create("account", {"name": "Fabrikam"})
   result = batch.execute()
BatchQueryOperations

Query operations on a BatchRequest.

Mirrors client.query exactly: same method names, same signatures. All methods return None; results arrive via BatchResult.

Do not instantiate directly; use batch.query.

BatchRecordOperations

Record operations on a BatchRequest.

Mirrors client.records: same method names, same signatures. All methods return None; results are available via BatchResult after execute.

GA methods: retrieve (single record) and list (multi-record, single page). get is deprecated — use retrieve instead.

Do not instantiate directly; use batch.records.

BatchRequest

Builder for constructing and executing a Dataverse OData $batch request.

Obtain via new (client.batch.new()). Add operations through records, tables, query, and dataframe, optionally group writes into a changeset, then call execute.

Operations are executed sequentially in the order added. The resulting BatchResult contains one BatchItemResponse per HTTP request dispatched (some operations expand to multiple requests).

Note

Maximum 1000 HTTP operations per batch.

Example:


   batch = client.batch.new()
   batch.records.create("account", {"name": "Contoso"})
   batch.tables.get("account")
   with batch.changeset() as cs:
       ref = cs.records.create("contact", {"firstname": "Alice"})
       cs.records.update("account", account_id, {
           "primarycontactid@odata.bind": ref
       })
   result = batch.execute()
BatchTableOperations

Table metadata operations on a BatchRequest.

Mirrors client.tables exactly: same method names, same signatures. All methods return None; results arrive via BatchResult.

Note

tables.delete, tables.add_columns, and tables.remove_columns

require a metadata lookup (GET EntityDefinitions) at

execute time to resolve the table's MetadataId.

This lookup is transparent to the caller.

Note

tables.add_columns and tables.remove_columns each produce one

batch item per column, so they contribute multiple entries to

responses.

Do not instantiate directly; use batch.tables.

ChangeSet

A transactional group of single-record write operations.

All operations succeed or are rolled back together. Use as a context manager or call records to add operations directly.

Do not instantiate directly; use changeset.

Example:


   with batch.changeset() as cs:
       ref = cs.records.create("contact", {"firstname": "Alice"})
       cs.records.update("account", account_id, {
           "primarycontactid@odata.bind": ref
       })
ChangeSetRecordOperations

Record write operations available inside a ChangeSet.

Mirrors client.records but restricted to single-record forms (no bulk create/update/delete). Only write operations are allowed — GET is not permitted inside a changeset.

Do not instantiate directly; use ChangeSet.records.