S3FileTransformOperator

Amazon

Copies data from a source S3 location to a temporary location on the local filesystem. Runs a transformation on this file as specified by the transformation script and uploads the output to a destination S3 location.

View on GitHub

Last Updated: Jun. 28, 2021

Access Instructions

Install the Amazon provider package into your Airflow environment.

Import the module into your DAG file and instantiate it with your desired params.

Parameters

source_s3_keyRequiredstrThe key to be retrieved from S3. (templated)
dest_s3_keyRequiredstrThe key to be written from S3. (templated)
transform_scriptstrlocation of the executable transformation script
select_expressionstrS3 Select expression
script_argssequence of strarguments for transformation script (templated)
source_aws_conn_idstrsource s3 connection
source_verifybool or strWhether or not to verify SSL certificates for S3 connection. By default SSL certificates are verified. You can provide the following values: False: do not validate SSL certificates. SSL will still be used(unless use_ssl is False), but SSL certificates will not be verified. path/to/cert/bundle.pem: A filename of the CA cert bundle to uses.You can specify this argument if you want to use a different CA cert bundle than the one used by botocore. This is also applicable to dest_verify.
dest_aws_conn_idstrdestination s3 connection
dest_verifybool or strWhether or not to verify SSL certificates for S3 connection. See: source_verify
replaceboolReplace dest S3 key if it already exists

Documentation

Copies data from a source S3 location to a temporary location on the local filesystem. Runs a transformation on this file as specified by the transformation script and uploads the output to a destination S3 location.

The locations of the source and the destination files in the local filesystem is provided as an first and second arguments to the transformation script. The transformation script is expected to read the data from source, transform it and write the output to the local destination file. The operator then takes over control and uploads the local destination file to S3.

S3 Select is also available to filter the source contents. Users can omit the transformation script if S3 Select expression is specified.

Was this page helpful?