ramitkataria commented on code in PR #46579: URL: https://github.com/apache/airflow/pull/46579#discussion_r1953213360
########## providers/src/airflow/providers/amazon/aws/operators/mwaa.py: ########## @@ -0,0 +1,111 @@ +# 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. +"""This module contains AWS MWAA operators.""" + +from __future__ import annotations + +from collections.abc import Sequence +from typing import TYPE_CHECKING + +from airflow.providers.amazon.aws.hooks.mwaa import MwaaHook +from airflow.providers.amazon.aws.operators.base_aws import AwsBaseOperator +from airflow.providers.amazon.aws.utils.mixins import aws_template_fields + +if TYPE_CHECKING: + from airflow.utils.context import Context + + +class MwaaTriggerDagRunOperator(AwsBaseOperator[MwaaHook]): + """ + Trigger a Dag Run for a Dag in an Amazon MWAA environment. + + .. seealso:: + For more information on how to use this operator, take a look at the guide: + :ref:`howto/operator:MwaaTriggerDagRunOperator` + + :param env_name: The MWAA environment name (templated) + :param trigger_dag_id: The ID of the DAG to be triggered (templated) + :param trigger_run_id: The Run ID. The value of this field can be set only when creating the object. This + together with trigger_dag_id are a unique key. (templated) + :param logical_date: The logical date (previously called execution date). This is the time or interval + covered by this DAG run, according to the DAG definition. The value of this field can be set only when + creating the object. This together with trigger_dag_id are a unique key. (templated) + :param data_interval_start: The beginning of the interval the DAG run covers + :param data_interval_end: The end of the interval the DAG run covers + :param conf: Additional configuration parameters. The value of this field can be set only when creating + the object. (templated) + :param note: Contains manually entered notes by the user about the DagRun. (templated) + """ + + aws_hook_class = MwaaHook + template_fields: Sequence[str] = aws_template_fields( + "env_name", + "trigger_dag_id", + "trigger_run_id", + "logical_date", + "data_interval_start", + "data_interval_end", + "conf", + "note", + ) + template_fields_renderers = {"conf": "json"} + ui_color = "#6ad3fa" + + def __init__( + self, + *, + env_name: str, + trigger_dag_id: str, + trigger_run_id: str | None = None, + logical_date: str | None = None, + data_interval_start: str | None = None, + data_interval_end: str | None = None, + conf: dict | None = None, + note: str | None = None, + **kwargs, + ): + super().__init__(**kwargs) Review Comment: Yep, makes sense -- 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-unsubscr...@airflow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org