Skip to content

Commit 0fcdc5e

Browse files
authored
S3ToGCSOperator: Remove dest_gcs_conn_id (#23348)
1 parent 05ccfd4 commit 0fcdc5e

File tree

3 files changed

+5
-17
lines changed

3 files changed

+5
-17
lines changed

β€Žairflow/providers/google/CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ Breaking changes
132132
``GCSToLocalFilesystemOperator``
133133
``LocalFilesystemToGCSOperator``
134134

135+
* ``S3ToGCSOperator``: Remove ``dest_gcs_conn_id``. Please use ``gcp_conn_id``
136+
135137
* ``BigQueryHook.create_empty_table`` Remove ``num_retries``. Please use ``retry``.
136138

137139
* ``BigQueryHook.run_grant_dataset_view_access`` Remove ``source_project``. Please use ``project_id``.

β€Žairflow/providers/google/cloud/transfers/s3_to_gcs.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# KIND, either express or implied. See the License for the
1616
# specific language governing permissions and limitations
1717
# under the License.
18-
import warnings
1918
from tempfile import NamedTemporaryFile
2019
from typing import TYPE_CHECKING, Optional, Sequence, Union
2120

@@ -57,8 +56,6 @@ class S3ToGCSOperator(S3ListOperator):
5756
You can specify this argument if you want to use a different
5857
CA cert bundle than the one used by botocore.
5958
:param gcp_conn_id: (Optional) The connection ID used to connect to Google Cloud.
60-
:param dest_gcs_conn_id: (Deprecated) The connection ID used to connect to Google Cloud.
61-
This parameter has been deprecated. You should pass the gcp_conn_id parameter instead.
6259
:param dest_gcs: The destination Google Cloud Storage bucket and prefix
6360
where you want to store the files. (templated)
6461
:param delegate_to: Google account to impersonate using domain-wide delegation of authority,
@@ -85,7 +82,7 @@ class S3ToGCSOperator(S3ListOperator):
8582
task_id="s3_to_gcs_example",
8683
bucket="my-s3-bucket",
8784
prefix="data/customers-201804",
88-
dest_gcs_conn_id="google_cloud_default",
85+
gcp_conn_id="google_cloud_default",
8986
dest_gcs="gs://my.gcs.bucket/some/customers/",
9087
replace=False,
9188
gzip=True,
@@ -114,7 +111,6 @@ def __init__(
114111
aws_conn_id='aws_default',
115112
verify=None,
116113
gcp_conn_id='google_cloud_default',
117-
dest_gcs_conn_id=None,
118114
dest_gcs=None,
119115
delegate_to=None,
120116
replace=False,
@@ -124,16 +120,6 @@ def __init__(
124120
):
125121

126122
super().__init__(bucket=bucket, prefix=prefix, delimiter=delimiter, aws_conn_id=aws_conn_id, **kwargs)
127-
128-
if dest_gcs_conn_id:
129-
warnings.warn(
130-
"The dest_gcs_conn_id parameter has been deprecated. You should pass "
131-
"the gcp_conn_id parameter.",
132-
DeprecationWarning,
133-
stacklevel=3,
134-
)
135-
gcp_conn_id = dest_gcs_conn_id
136-
137123
self.gcp_conn_id = gcp_conn_id
138124
self.dest_gcs = dest_gcs
139125
self.delegate_to = delegate_to

β€Žtests/providers/google/cloud/transfers/test_s3_to_gcs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def test_execute(self, gcs_mock_hook, s3_one_mock_hook, s3_two_mock_hook):
6565
bucket=S3_BUCKET,
6666
prefix=S3_PREFIX,
6767
delimiter=S3_DELIMITER,
68-
dest_gcs_conn_id=GCS_CONN_ID,
68+
gcp_conn_id=GCS_CONN_ID,
6969
dest_gcs=GCS_PATH_PREFIX,
7070
google_impersonation_chain=IMPERSONATION_CHAIN,
7171
)
@@ -105,7 +105,7 @@ def test_execute_with_gzip(self, gcs_mock_hook, s3_one_mock_hook, s3_two_mock_ho
105105
bucket=S3_BUCKET,
106106
prefix=S3_PREFIX,
107107
delimiter=S3_DELIMITER,
108-
dest_gcs_conn_id=GCS_CONN_ID,
108+
gcp_conn_id=GCS_CONN_ID,
109109
dest_gcs=GCS_PATH_PREFIX,
110110
gzip=True,
111111
)

0 commit comments

Comments
 (0)