ferruzzi commented on code in PR #32498:
URL: https://github.com/apache/airflow/pull/32498#discussion_r1264209408


##########
tests/system/providers/amazon/aws/example_eventbridge.py:
##########
@@ -0,0 +1,54 @@
+# 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 __future__ import annotations
+
+from datetime import datetime
+
+from airflow import DAG
+from airflow.providers.amazon.aws.operators.eventbridge import 
EventBridgePutEventsOperator
+
+DAG_ID = "example_eventbridge"
+ENTRIES = [
+    {
+        "Detail": '{"event-name": "custom-event"}',
+        "EventBusName": "custom-bus",
+        "Source": "example.myapp",
+        "DetailType": "Sample Custom Event",
+    }
+]
+
+with DAG(
+    dag_id=DAG_ID,
+    schedule="@once",
+    start_date=datetime(2021, 1, 1),
+    tags=["example"],
+    catchup=False,
+) as dag:
+
+    # [START howto_operator_eventbridge_put_events]
+
+    put_events = EventBridgePutEventsOperator(
+        task_id="put_events_task", entries=ENTRIES, region_name="us-east-1"
+    )
+
+    # [END howto_operator_eventbridge_put_events]
+

Review Comment:
   When you add another task you'll also need to add the watcher (see other 
system tests for examples) but I think this should be fine for now.



##########
tests/system/providers/amazon/aws/example_eventbridge.py:
##########
@@ -0,0 +1,54 @@
+# 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 __future__ import annotations
+
+from datetime import datetime
+
+from airflow import DAG
+from airflow.providers.amazon.aws.operators.eventbridge import 
EventBridgePutEventsOperator
+
+DAG_ID = "example_eventbridge"
+ENTRIES = [
+    {
+        "Detail": '{"event-name": "custom-event"}',
+        "EventBusName": "custom-bus",
+        "Source": "example.myapp",
+        "DetailType": "Sample Custom Event",
+    }
+]
+
+with DAG(
+    dag_id=DAG_ID,
+    schedule="@once",
+    start_date=datetime(2021, 1, 1),
+    tags=["example"],
+    catchup=False,
+) as dag:
+
+    # [START howto_operator_eventbridge_put_events]
+
+    put_events = EventBridgePutEventsOperator(
+        task_id="put_events_task", entries=ENTRIES, region_name="us-east-1"

Review Comment:
   I think we can drop the region name.  We want to keep these as minimal as 
possible since they are getting embedded in docs and region_name gets a default 
value in the operator, so it's not required.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to