You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/12/15 10:14:40 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #20263: rewrite opsgenie alert hook with official python sdk, related issue #18641

uranusjr commented on a change in pull request #20263:
URL: https://github.com/apache/airflow/pull/20263#discussion_r769475283



##########
File path: tests/providers/opsgenie/hooks/test_opsgenie_alert.py
##########
@@ -45,7 +45,7 @@ class TestOpsgenieAlertHook(unittest.TestCase):
             {'id': '80564037-1984-4f38-b98e-8a1f662df552', 'type': 'schedule'},
             {'name': 'First Responders Schedule', 'type': 'schedule'},
         ],
-        'visibleTo': [
+        'visible_to': [

Review comment:
       So this is a backward incompatible change right? We’ll need to bump the provider’s major version if so.

##########
File path: airflow/providers/opsgenie/example_dags/example_opsgenie_alert.py
##########
@@ -0,0 +1,31 @@
+# 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 datetime import datetime
+
+from airflow import DAG
+from airflow.providers.opsgenie.operators.opsgenie_alert import OpsgenieAlertOperator
+
+with DAG(
+    dag_id="opsgenie_alert_operator_dag",
+    schedule_interval=None,
+    start_date=datetime(2021, 1, 1),
+    catchup=False,
+) as dag:
+
+    # [START howto_opsgenie_alert_operator]
+    opsgenie_alert_operator = OpsgenieAlertOperator(task_id="opsgenie_task", message="Hello World!")
+    # [END howto_opsgenie_alert_operator]

Review comment:
       Do you plan to add documentation as well? Because otherwise this START-END combination is not needed (it’s used to load example code into documentation).




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org