airflow.providers.salesforce.operators.bulk

Classes

SalesforceBulkOperator

Execute a Salesforce Bulk API and pushes results to xcom.

Module Contents

class airflow.providers.salesforce.operators.bulk.SalesforceBulkOperator(*, operation, object_name, payload, external_id_field='Id', batch_size=10000, use_serial=False, salesforce_conn_id='salesforce_default', max_retries=0, bulk_retry_delay=5.0, transient_error_codes=_DEFAULT_TRANSIENT_ERROR_CODES, **kwargs)[source]

Bases: airflow.providers.common.compat.sdk.BaseOperator

Execute a Salesforce Bulk API and pushes results to xcom.

See also

For more information on how to use this operator, take a look at the guide: SalesforceBulkOperator

Parameters:
  • operation (Literal['insert', 'update', 'upsert', 'delete', 'hard_delete']) – Bulk operation to be performed Available operations are in [‘insert’, ‘update’, ‘upsert’, ‘delete’, ‘hard_delete’]

  • object_name (str) – The name of the Salesforce object

  • payload (list) – list of dict to be passed as a batch

  • external_id_field (str) – unique identifier field for upsert operations

  • batch_size (int) – number of records to assign for each batch in the job

  • use_serial (bool) – Process batches in serial mode

  • salesforce_conn_id (str) – The Salesforce Connection id.

  • max_retries (int) – Number of times to re-submit records that failed with a transient error code such as UNABLE_TO_LOCK_ROW or API_TEMPORARILY_UNAVAILABLE. Set to 0 (the default) to disable automatic retries.

  • bulk_retry_delay (float) – Seconds to wait before each retry attempt within the Bulk API retry loop. Defaults to 5.

  • transient_error_codes (collections.abc.Iterable[str]) – Collection of Salesforce error statusCode values that should trigger a retry. Defaults to {"UNABLE_TO_LOCK_ROW", "API_TEMPORARILY_UNAVAILABLE"}.

template_fields: collections.abc.Sequence[str] = ('object_name', 'payload', 'external_id_field')[source]
available_operations = ('insert', 'update', 'upsert', 'delete', 'hard_delete')[source]
operation[source]
object_name[source]
payload[source]
external_id_field = 'Id'[source]
batch_size = 10000[source]
use_serial = False[source]
salesforce_conn_id = 'salesforce_default'[source]
max_retries = 0[source]
bulk_retry_delay = 5.0[source]
transient_error_codes[source]
execute(context)[source]

Make an HTTP request to Salesforce Bulk API.

Parameters:

context (airflow.providers.common.compat.sdk.Context) – The task context during execution.

Returns:

API response if do_xcom_push is True

Was this entry helpful?