airflow-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] bart-eijk commented on a change in pull request #3961: [AIRFLOW-2794] Add WasbDeleteBlobOperator
Date Mon, 01 Oct 2018 11:08:41 GMT
bart-eijk commented on a change in pull request #3961: [AIRFLOW-2794] Add WasbDeleteBlobOperator
URL: https://github.com/apache/incubator-airflow/pull/3961#discussion_r221570570
 
 

 ##########
 File path: airflow/contrib/operators/wasb_delete_blob_operator.py
 ##########
 @@ -0,0 +1,71 @@
+# -*- coding: utf-8 -*-
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+from airflow.contrib.hooks.wasb_hook import WasbHook
+from airflow.models import BaseOperator
+from airflow.utils.decorators import apply_defaults
+
+
+class WasbDeleteBlobOperator(BaseOperator):
+    """
+    Deletes blob(s) on Azure Blob Storage.
+
+    :param container_name: Name of the container. (templated)
+    :type container_name: str
+    :param blob_name: Name of the blob. (templated)
+    :type blob_name: str
+    :param wasb_conn_id: Reference to the wasb connection. (templated)
+    :type wasb_conn_id: str
+    :param check_options: Optional keyword arguments that
+        `WasbHook.check_for_blob()` takes.
+    :param is_prefix: If blob_name is a prefix, delete all files matching prefix.
+    :type is_prefix: bool
+    :param ignore_if_missing: if True, then return success even if the
+    blob does not exist.
+    :type ignore_if_missing: bool
+    """
+
+    template_fields = ('container_name', 'blob_name', 'wasb_conn_id')
 
 Review comment:
   Good point. None of the other WasbOperators do so.
   It does happen in some of the other operators, though, such as:
   * airflow.contrib.operators.gcp_container_operator.GKEClusterDeleteOperator
   * airflow.contrib.operators.sqoop_operator.SqoopOperator
   
   Do you think we should remove it, so that it's in line with the other WasbOperators?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message