From 571645ebd783412cc4e7b6754ffc2b6cce42d3a4 Mon Sep 17 00:00:00 2001 From: Akash Sharma <2akash111998@gmail.com> Date: Wed, 7 Jun 2023 18:34:11 +0530 Subject: [PATCH 1/2] removed unused variable --- .../microsoft/azure/transfers/azure_blob_to_gcs.py | 3 --- .../microsoft/azure/transfers/test_azure_blob_to_gcs.py | 4 ---- .../microsoft/azure/example_azure_blob_to_gcs.py | 9 ++++++--- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/airflow/providers/microsoft/azure/transfers/azure_blob_to_gcs.py b/airflow/providers/microsoft/azure/transfers/azure_blob_to_gcs.py index 05c3350a7a6f0..a76af8e43b18c 100644 --- a/airflow/providers/microsoft/azure/transfers/azure_blob_to_gcs.py +++ b/airflow/providers/microsoft/azure/transfers/azure_blob_to_gcs.py @@ -61,7 +61,6 @@ def __init__( wasb_conn_id="wasb_default", gcp_conn_id: str = "google_cloud_default", blob_name: str, - file_path: str, container_name: str, bucket_name: str, object_name: str, @@ -74,7 +73,6 @@ def __init__( self.wasb_conn_id = wasb_conn_id self.gcp_conn_id = gcp_conn_id self.blob_name = blob_name - self.file_path = file_path self.container_name = container_name self.bucket_name = bucket_name self.object_name = object_name @@ -84,7 +82,6 @@ def __init__( template_fields: Sequence[str] = ( "blob_name", - "file_path", "container_name", "bucket_name", "object_name", diff --git a/tests/providers/microsoft/azure/transfers/test_azure_blob_to_gcs.py b/tests/providers/microsoft/azure/transfers/test_azure_blob_to_gcs.py index e7d2ba6833814..4bc51895f3e4c 100644 --- a/tests/providers/microsoft/azure/transfers/test_azure_blob_to_gcs.py +++ b/tests/providers/microsoft/azure/transfers/test_azure_blob_to_gcs.py @@ -23,7 +23,6 @@ WASB_CONN_ID = "wasb_default" GCP_CONN_ID = "google_cloud_default" BLOB_NAME = "azure_blob" -FILE_PATH = "/file/to/path" CONTAINER_NAME = "azure_container" BUCKET_NAME = "airflow" OBJECT_NAME = "file.txt" @@ -39,7 +38,6 @@ def test_init(self): wasb_conn_id=WASB_CONN_ID, gcp_conn_id=GCP_CONN_ID, blob_name=BLOB_NAME, - file_path=FILE_PATH, container_name=CONTAINER_NAME, bucket_name=BUCKET_NAME, object_name=OBJECT_NAME, @@ -50,7 +48,6 @@ def test_init(self): ) assert operator.wasb_conn_id == WASB_CONN_ID assert operator.blob_name == BLOB_NAME - assert operator.file_path == FILE_PATH assert operator.container_name == CONTAINER_NAME assert operator.gcp_conn_id == GCP_CONN_ID assert operator.bucket_name == BUCKET_NAME @@ -68,7 +65,6 @@ def test_execute(self, mock_temp, mock_hook_gcs, mock_hook_wasb): wasb_conn_id=WASB_CONN_ID, gcp_conn_id=GCP_CONN_ID, blob_name=BLOB_NAME, - file_path=FILE_PATH, container_name=CONTAINER_NAME, bucket_name=BUCKET_NAME, object_name=OBJECT_NAME, diff --git a/tests/system/providers/microsoft/azure/example_azure_blob_to_gcs.py b/tests/system/providers/microsoft/azure/example_azure_blob_to_gcs.py index 5cf021679a314..81fb9993b25dd 100644 --- a/tests/system/providers/microsoft/azure/example_azure_blob_to_gcs.py +++ b/tests/system/providers/microsoft/azure/example_azure_blob_to_gcs.py @@ -45,7 +45,12 @@ DAG_ID, schedule=None, start_date=datetime(2021, 1, 1), # Override to match your needs - default_args={"container_name": AZURE_CONTAINER_NAME, "blob_name": BLOB_NAME, "prefix": PREFIX_NAME}, + default_args={ + # azure args + "container_name": AZURE_CONTAINER_NAME, + "blob_name": BLOB_NAME, + "prefix": PREFIX_NAME, + }, ) as dag: wait_for_blob = WasbBlobSensor(task_id="wait_for_blob") @@ -60,8 +65,6 @@ transfer_files_to_gcs = AzureBlobStorageToGCSOperator( task_id="transfer_files_to_gcs", - # AZURE arg - file_path=GCP_OBJECT_NAME, # GCP args bucket_name=GCP_BUCKET_NAME, object_name=GCP_OBJECT_NAME, From 1ef5e754576e2c526187fa6a02b7c79bdd12eb30 Mon Sep 17 00:00:00 2001 From: Akash Sharma <2akash111998@gmail.com> Date: Wed, 7 Jun 2023 18:35:52 +0530 Subject: [PATCH 2/2] removed unused variable --- airflow/providers/microsoft/azure/transfers/azure_blob_to_gcs.py | 1 - 1 file changed, 1 deletion(-) diff --git a/airflow/providers/microsoft/azure/transfers/azure_blob_to_gcs.py b/airflow/providers/microsoft/azure/transfers/azure_blob_to_gcs.py index a76af8e43b18c..8ba6f2d6eb079 100644 --- a/airflow/providers/microsoft/azure/transfers/azure_blob_to_gcs.py +++ b/airflow/providers/microsoft/azure/transfers/azure_blob_to_gcs.py @@ -39,7 +39,6 @@ class AzureBlobStorageToGCSOperator(BaseOperator): :param wasb_conn_id: Reference to the wasb connection. :param gcp_conn_id: The connection ID to use when fetching connection info. :param blob_name: Name of the blob - :param file_path: Path to the file to download :param container_name: Name of the container :param bucket_name: The bucket to upload to :param object_name: The object name to set when uploading the file