From c82b3b94660a38360f61d47676ed180a0d32c189 Mon Sep 17 00:00:00 2001 From: eladkal <45845474+eladkal@users.noreply.github.com> Date: Thu, 28 Apr 2022 20:07:26 +0300 Subject: [PATCH] `GCSFileTransformOperator`: New templated fields `source_object`, `destination_object` (#23328) * `GCSFileTransformOperator`: New templated fields `source_object`, `destination_object` * Add `source_object`, `destination_object` as templated fields * fix docstring closes: #23327 --- airflow/providers/google/cloud/operators/gcs.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/airflow/providers/google/cloud/operators/gcs.py b/airflow/providers/google/cloud/operators/gcs.py index a39f5fd713be3..8a9ce7a339d43 100644 --- a/airflow/providers/google/cloud/operators/gcs.py +++ b/airflow/providers/google/cloud/operators/gcs.py @@ -536,8 +536,12 @@ class GCSFileTransformOperator(BaseOperator): data from source, transform it and write the output to the local destination file. - :param source_bucket: The key to be retrieved from GCS. (templated) - :param destination_bucket: The key to be written from GCS. (templated) + :param source_bucket: The bucket to locate the source_object. (templated) + :param source_object: The key to be retrieved from GCS. (templated) + :param destination_bucket: The bucket to upload the key after transformation. + If not provided, source_bucket will be used. (templated) + :param destination_object: The key to be written in GCS. + If not provided, source_object will be used. (templated) :param transform_script: location of the executable transformation script or list of arguments passed to subprocess ex. `['python', 'script.py', 10]`. (templated) :param gcp_conn_id: The connection ID to use connecting to Google Cloud. @@ -553,7 +557,9 @@ class GCSFileTransformOperator(BaseOperator): template_fields: Sequence[str] = ( 'source_bucket', + 'source_object', 'destination_bucket', + 'destination_object', 'transform_script', 'impersonation_chain', )