Skip to content

Commit 9412830

Browse files
authored
Removed unused variables in AzureBlobStorageToGCSOperator (#31765)
* removed unused variable * removed unused variable
1 parent fba6f86 commit 9412830

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

airflow/providers/microsoft/azure/transfers/azure_blob_to_gcs.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ class AzureBlobStorageToGCSOperator(BaseOperator):
3939
:param wasb_conn_id: Reference to the wasb connection.
4040
:param gcp_conn_id: The connection ID to use when fetching connection info.
4141
:param blob_name: Name of the blob
42-
:param file_path: Path to the file to download
4342
:param container_name: Name of the container
4443
:param bucket_name: The bucket to upload to
4544
:param object_name: The object name to set when uploading the file
@@ -61,7 +60,6 @@ def __init__(
6160
wasb_conn_id="wasb_default",
6261
gcp_conn_id: str = "google_cloud_default",
6362
blob_name: str,
64-
file_path: str,
6563
container_name: str,
6664
bucket_name: str,
6765
object_name: str,
@@ -74,7 +72,6 @@ def __init__(
7472
self.wasb_conn_id = wasb_conn_id
7573
self.gcp_conn_id = gcp_conn_id
7674
self.blob_name = blob_name
77-
self.file_path = file_path
7875
self.container_name = container_name
7976
self.bucket_name = bucket_name
8077
self.object_name = object_name
@@ -84,7 +81,6 @@ def __init__(
8481

8582
template_fields: Sequence[str] = (
8683
"blob_name",
87-
"file_path",
8884
"container_name",
8985
"bucket_name",
9086
"object_name",

tests/providers/microsoft/azure/transfers/test_azure_blob_to_gcs.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
WASB_CONN_ID = "wasb_default"
2424
GCP_CONN_ID = "google_cloud_default"
2525
BLOB_NAME = "azure_blob"
26-
FILE_PATH = "/file/to/path"
2726
CONTAINER_NAME = "azure_container"
2827
BUCKET_NAME = "airflow"
2928
OBJECT_NAME = "file.txt"
@@ -39,7 +38,6 @@ def test_init(self):
3938
wasb_conn_id=WASB_CONN_ID,
4039
gcp_conn_id=GCP_CONN_ID,
4140
blob_name=BLOB_NAME,
42-
file_path=FILE_PATH,
4341
container_name=CONTAINER_NAME,
4442
bucket_name=BUCKET_NAME,
4543
object_name=OBJECT_NAME,
@@ -50,7 +48,6 @@ def test_init(self):
5048
)
5149
assert operator.wasb_conn_id == WASB_CONN_ID
5250
assert operator.blob_name == BLOB_NAME
53-
assert operator.file_path == FILE_PATH
5451
assert operator.container_name == CONTAINER_NAME
5552
assert operator.gcp_conn_id == GCP_CONN_ID
5653
assert operator.bucket_name == BUCKET_NAME
@@ -68,7 +65,6 @@ def test_execute(self, mock_temp, mock_hook_gcs, mock_hook_wasb):
6865
wasb_conn_id=WASB_CONN_ID,
6966
gcp_conn_id=GCP_CONN_ID,
7067
blob_name=BLOB_NAME,
71-
file_path=FILE_PATH,
7268
container_name=CONTAINER_NAME,
7369
bucket_name=BUCKET_NAME,
7470
object_name=OBJECT_NAME,

tests/system/providers/microsoft/azure/example_azure_blob_to_gcs.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@
4545
DAG_ID,
4646
schedule=None,
4747
start_date=datetime(2021, 1, 1), # Override to match your needs
48-
default_args={"container_name": AZURE_CONTAINER_NAME, "blob_name": BLOB_NAME, "prefix": PREFIX_NAME},
48+
default_args={
49+
# azure args
50+
"container_name": AZURE_CONTAINER_NAME,
51+
"blob_name": BLOB_NAME,
52+
"prefix": PREFIX_NAME,
53+
},
4954
) as dag:
5055
wait_for_blob = WasbBlobSensor(task_id="wait_for_blob")
5156

@@ -60,8 +65,6 @@
6065

6166
transfer_files_to_gcs = AzureBlobStorageToGCSOperator(
6267
task_id="transfer_files_to_gcs",
63-
# AZURE arg
64-
file_path=GCP_OBJECT_NAME,
6568
# GCP args
6669
bucket_name=GCP_BUCKET_NAME,
6770
object_name=GCP_OBJECT_NAME,

0 commit comments

Comments
 (0)