airflow.providers.amazon.aws.transfers.salesforce_to_s3

Module Contents

Classes

SalesforceToS3Operator

Submits a Salesforce query and uploads the results to AWS S3.

class airflow.providers.amazon.aws.transfers.salesforce_to_s3.SalesforceToS3Operator(*, salesforce_query, s3_bucket_name, s3_key, salesforce_conn_id, export_format='csv', query_params=None, include_deleted=False, coerce_to_timestamp=False, record_time_added=False, aws_conn_id='aws_default', replace=False, encrypt=False, gzip=False, acl_policy=None, **kwargs)[source]

Bases: airflow.models.BaseOperator

Submits a Salesforce query and uploads the results to AWS S3.

See also

For more information on how to use this operator, take a look at the guide: Extract data from Salesforce to Amazon S3 transfer operator

Parameters
  • salesforce_query (str) – The query to send to Salesforce.

  • s3_bucket_name (str) – The bucket name to upload to.

  • s3_key (str) – The object name to set when uploading the file.

  • salesforce_conn_id (str) – The name of the connection that has the parameters needed to connect to Salesforce.

  • export_format (str) – Desired format of files to be exported.

  • query_params (Optional[Dict]) – Additional optional arguments to be passed to the HTTP request querying Salesforce.

  • include_deleted (bool) – True if the query should include deleted records.

  • coerce_to_timestamp (bool) – True if you want all datetime fields to be converted into Unix timestamps. False if you want them to be left in the same format as they were in Salesforce. Leaving the value as False will result in datetimes being strings. Default: False

  • record_time_added (bool) – True if you want to add a Unix timestamp field to the resulting data that marks when the data was fetched from Salesforce. Default: False

  • aws_conn_id (str) – The name of the connection that has the parameters we need to connect to S3.

  • replace (bool) – A flag to decide whether or not to overwrite the S3 key if it already exists. If set to False and the key exists an error will be raised.

  • encrypt (bool) – If True, the file will be encrypted on the server-side by S3 and will be stored in an encrypted form while at rest in S3.

  • gzip (bool) – If True, the file will be compressed locally.

  • acl_policy (Optional[str]) – String specifying the canned ACL policy for the file being uploaded to the S3 bucket.

template_fields :Sequence[str] = ['salesforce_query', 's3_bucket_name', 's3_key'][source]
template_ext :Sequence[str] = ['.sql'][source]
template_fields_renderers[source]
execute(self, context)[source]

This is the main method to derive when creating an operator. Context is the same dictionary used as when rendering jinja templates.

Refer to get_template_context for more context.

Was this entry helpful?