diff --git a/airflow/contrib/operators/s3_copy_object_operator.py b/airflow/contrib/operators/s3_copy_object_operator.py index 330138ed27594..43651707f8925 100644 --- a/airflow/contrib/operators/s3_copy_object_operator.py +++ b/airflow/contrib/operators/s3_copy_object_operator.py @@ -29,21 +29,21 @@ class S3CopyObjectOperator(BaseOperator): Note: the S3 connection used here needs to have access to both source and destination bucket/key. - :param source_bucket_key: The key of the source object. + :param source_bucket_key: The key of the source object. (templated) It can be either full s3:// style url or relative path from root level. When it's specified as a full s3:// url, please omit source_bucket_name. :type source_bucket_key: str - :param dest_bucket_key: The key of the object to copy to. + :param dest_bucket_key: The key of the object to copy to. (templated) The convention to specify `dest_bucket_key` is the same as `source_bucket_key`. :type dest_bucket_key: str - :param source_bucket_name: Name of the S3 bucket where the source object is in. + :param source_bucket_name: Name of the S3 bucket where the source object is in. (templated) It should be omitted when `source_bucket_key` is provided as a full s3:// url. :type source_bucket_name: str - :param dest_bucket_name: Name of the S3 bucket to where the object is copied. + :param dest_bucket_name: Name of the S3 bucket to where the object is copied. (templated) It should be omitted when `dest_bucket_key` is provided as a full s3:// url. :type dest_bucket_name: str @@ -65,6 +65,9 @@ class S3CopyObjectOperator(BaseOperator): :type verify: bool or str """ + template_fields = ('source_bucket_key', 'dest_bucket_key', + 'source_bucket_name', 'dest_bucket_name') + @apply_defaults def __init__( self, diff --git a/airflow/contrib/operators/s3_delete_objects_operator.py b/airflow/contrib/operators/s3_delete_objects_operator.py index 76caace90f7b9..926667b497195 100644 --- a/airflow/contrib/operators/s3_delete_objects_operator.py +++ b/airflow/contrib/operators/s3_delete_objects_operator.py @@ -30,9 +30,9 @@ class S3DeleteObjectsOperator(BaseOperator): Users may specify up to 1000 keys to delete. - :param bucket: Name of the bucket in which you are going to delete object(s) + :param bucket: Name of the bucket in which you are going to delete object(s). (templated) :type bucket: str - :param keys: The key(s) to delete from S3 bucket. + :param keys: The key(s) to delete from S3 bucket. (templated) When ``keys`` is a string, it's supposed to be the key name of the single object to delete. @@ -58,6 +58,8 @@ class S3DeleteObjectsOperator(BaseOperator): :type verify: bool or str """ + template_fields = ('keys', 'bucket') + @apply_defaults def __init__( self,