aaron-y-chen commented on code in PR #73509: URL: https://github.com/apache/airflow/pull/73509#discussion_r4075431407
########## providers/amazon/tests/system/amazon/aws/example_kinesis_message_queue.py: ########## @@ -0,0 +1,98 @@ +# 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. +""" +Example Dag demonstrating event-driven scheduling with Amazon Kinesis Data Streams. + +NOTE: This file serves as an example Dag and reference for AssetWatcher configuration. +It is NOT an automated end-to-end integration test: running this file directly (e.g. via +pytest system-test harness) initiates a manual DagRun where `triggering_asset_events` +is empty. Validating the complete event-driven chain requires a running Airflow triggerer, +an active Kinesis stream, and external records producing AssetEvents. + +Pre-requisites: +1. An active Amazon Kinesis Data Stream must exist and be accessible by the configured AWS connection. +2. The Airflow triggerer must be running with the ``common.messaging`` provider installed. +3. This is an event-driven Dag triggered by an AssetWatcher; it does not produce records to itself. +""" + +from __future__ import annotations + +import base64 +import os +from datetime import datetime + +from airflow.providers.common.messaging.triggers.msg_queue import MessageQueueTrigger +from airflow.sdk import DAG, Asset, AssetWatcher, task + +STREAM_NAME = os.getenv("KINESIS_STREAM_NAME", "airflow-kinesis-example-stream") +AWS_CONN_ID = os.getenv("AWS_CONN_ID", "aws_default") +AWS_REGION = os.getenv("AWS_REGION", "us-east-1") + +# [START howto_trigger_kinesis_message_queue] Review Comment: Oops, sorry for missing that. My bad. It's fixed now. -- 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]
