Skip to content

Commit 0373fb0

Browse files
eladkalpotiuk
authored andcommitted
GoogleDriveToGCSOperator: Remove destination_bucket and destination_object
1 parent d4a3348 commit 0373fb0

File tree

3 files changed

+7
-25
lines changed

3 files changed

+7
-25
lines changed

airflow/providers/google/CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ Breaking changes
3434
For more information, see `Deprecation and sunset <https://developers.google.com/google-ads/api/docs/sunset-dates>`_
3535
and `Upgrading to the newest version <https://developers.google.com/google-ads/api/docs/version-migration>`_
3636

37+
* ``GoogleDriveToGCSOperator``: Remove ``destination_bucket`` and ``destination_object``. Please use ``bucket_name`` and ``object_name``.
38+
3739
6.8.0
3840
.....
3941

airflow/providers/google/cloud/transfers/gdrive_to_gcs.py

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
import warnings
1918
from typing import TYPE_CHECKING, Optional, Sequence, Union
2019

2120
from airflow.models import BaseOperator
@@ -38,8 +37,6 @@ class GoogleDriveToGCSOperator(BaseOperator):
3837
file should be written to
3938
:param object_name: The Google Cloud Storage object name for the object created by the operator.
4039
For example: ``path/to/my/file/file.txt``.
41-
:param destination_bucket: Same as bucket_name, but for backward compatibly
42-
:param destination_object: Same as object_name, but for backward compatibly
4340
:param folder_id: The folder id of the folder in which the Google Drive file resides
4441
:param file_name: The name of the file residing in Google Drive
4542
:param drive_id: Optional. The id of the shared Google Drive in which the file resides.
@@ -69,10 +66,8 @@ class GoogleDriveToGCSOperator(BaseOperator):
6966
def __init__(
7067
self,
7168
*,
72-
bucket_name: Optional[str] = None,
69+
bucket_name: str,
7370
object_name: Optional[str] = None,
74-
destination_bucket: Optional[str] = None, # deprecated
75-
destination_object: Optional[str] = None, # deprecated
7671
file_name: str,
7772
folder_id: str,
7873
drive_id: Optional[str] = None,
@@ -82,23 +77,8 @@ def __init__(
8277
**kwargs,
8378
) -> None:
8479
super().__init__(**kwargs)
85-
if destination_bucket:
86-
warnings.warn(
87-
"`destination_bucket` is deprecated please use `bucket_name`",
88-
DeprecationWarning,
89-
stacklevel=2,
90-
)
91-
actual_bucket = destination_bucket or bucket_name
92-
if actual_bucket is None:
93-
raise RuntimeError("One of the destination_bucket or bucket_name must be set")
94-
self.bucket_name: str = actual_bucket
95-
self.object_name = destination_object or object_name
96-
if destination_object:
97-
warnings.warn(
98-
"`destination_object` is deprecated please use `object_name`",
99-
DeprecationWarning,
100-
stacklevel=2,
101-
)
80+
self.bucket_name = bucket_name
81+
self.object_name = object_name
10282
self.folder_id = folder_id
10383
self.drive_id = drive_id
10484
self.file_name = file_name

tests/providers/google/cloud/transfers/test_gdrive_to_gcs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def test_execute(self, mock_gdrive_hook, mock_gcs_hook):
3939
folder_id=FOLDER_ID,
4040
file_name=FILE_NAME,
4141
drive_id=DRIVE_ID,
42-
destination_bucket=BUCKET,
43-
destination_object=OBJECT,
42+
bucket_name=BUCKET,
43+
object_name=OBJECT,
4444
gcp_conn_id=GCP_CONN_ID,
4545
impersonation_chain=IMPERSONATION_CHAIN,
4646
)

0 commit comments

Comments
 (0)