You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/04/11 18:56:09 UTC

[airflow] branch main updated: Add SmoothOperator (#22813)

This is an automated email from the ASF dual-hosted git repository.

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new bc10265077 Add SmoothOperator (#22813)
bc10265077 is described below

commit bc10265077a6c1ace46951fccb7c2c85c56cbd15
Author: Tomek Urbaszek <tu...@apache.org>
AuthorDate: Mon Apr 11 20:55:58 2022 +0200

    Add SmoothOperator (#22813)
    
    Easter is coming so I just came with idea of an easter egg.
---
 airflow/operators/smooth.py | 35 +++++++++++++++++++++++++++++++++++
 docs/spelling_wordlist.txt  |  1 +
 2 files changed, 36 insertions(+)

diff --git a/airflow/operators/smooth.py b/airflow/operators/smooth.py
new file mode 100644
index 0000000000..9dcbccb9e0
--- /dev/null
+++ b/airflow/operators/smooth.py
@@ -0,0 +1,35 @@
+#
+# 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.models.baseoperator import BaseOperator
+from airflow.utils.context import Context
+
+
+class SmoothOperator(BaseOperator):
+    """
+    Operator that does literally nothing but it logs YouTube link to
+    Sade song "Smooth Operator".
+    """
+
+    ui_color = '#e8f7e4'
+    yt_link: str = "https://www.youtube.com/watch?v=4TYv2PhG89A"
+
+    def __init__(self, **kwargs) -> None:
+        super().__init__(**kwargs)
+
+    def execute(self, context: Context):
+        self.log.info("Enjoy Sade - Smooth Operator: %s", self.yt_link)
diff --git a/docs/spelling_wordlist.txt b/docs/spelling_wordlist.txt
index 744ea2027c..62a32d2624 100644
--- a/docs/spelling_wordlist.txt
+++ b/docs/spelling_wordlist.txt
@@ -1265,6 +1265,7 @@ runAsUser
 runnable
 runspace
 runtime
+sade
 sagemaker
 salesforce
 samesite