diff --git a/airflow/providers/google/cloud/transfers/sftp_to_gcs.py b/airflow/providers/google/cloud/transfers/sftp_to_gcs.py index eee8bd14b5a09..d22cc8ae3e4d1 100644 --- a/airflow/providers/google/cloud/transfers/sftp_to_gcs.py +++ b/airflow/providers/google/cloud/transfers/sftp_to_gcs.py @@ -97,8 +97,8 @@ def __init__( super().__init__(**kwargs) self.source_path = source_path - self.destination_path = self._set_destination_path(destination_path) - self.destination_bucket = self._set_bucket_name(destination_bucket) + self.destination_path = destination_path + self.destination_bucket = destination_bucket self.gcp_conn_id = gcp_conn_id self.mime_type = mime_type self.gzip = gzip @@ -108,6 +108,8 @@ def __init__( self.sftp_prefetch = sftp_prefetch def execute(self, context: Context): + self.destination_path = self._set_destination_path(self.destination_path) + self.destination_bucket = self._set_bucket_name(self.destination_bucket) gcs_hook = GCSHook( gcp_conn_id=self.gcp_conn_id, impersonation_chain=self.impersonation_chain,